Kea  2.1.7-git
isc::dhcp::ScopedEnableOptionsCopy< PktType > Class Template Reference

RAII object enabling copying options retrieved from the packet. More...

#include <pkt.h>

Public Types

typedef boost::shared_ptr< PktType > PktTypePtr
 Pointer to an encapsulated packet. More...
 

Public Member Functions

 ScopedEnableOptionsCopy (const PktTypePtr &pkt1, const PktTypePtr &pkt2=PktTypePtr())
 Constructor. More...
 
 ~ScopedEnableOptionsCopy ()
 Destructor. More...
 

Detailed Description

template<typename PktType>
class isc::dhcp::ScopedEnableOptionsCopy< PktType >

RAII object enabling copying options retrieved from the packet.

This object enables copying retrieved options from a packet within a scope in which this object exists. When the object goes out of scope copying options is disabled. This is applicable in cases when the server is going to invoke a callout (hook library) where copying options must be enabled by default. When the callouts return copying options should be disabled. The use of RAII object eliminates the need for explicitly re-disabling options copying and is safer in case of exceptions thrown by callouts and a presence of multiple exit points.

Template Parameters
PktTypeType of the packet, e.g. Pkt4, Pkt6, Pkt4o6.

Definition at line 40 of file pkt.h.

Member Typedef Documentation

◆ PktTypePtr

template<typename PktType>
typedef boost::shared_ptr<PktType> isc::dhcp::ScopedEnableOptionsCopy< PktType >::PktTypePtr

Pointer to an encapsulated packet.

Definition at line 44 of file pkt.h.

Constructor & Destructor Documentation

◆ ScopedEnableOptionsCopy()

template<typename PktType>
isc::dhcp::ScopedEnableOptionsCopy< PktType >::ScopedEnableOptionsCopy ( const PktTypePtr pkt1,
const PktTypePtr pkt2 = PktTypePtr() 
)
inline

Constructor.

Enables options copying on a packet(s).

Parameters
pkt1Pointer to first packet.
pkt2Optional pointer to the second packet.

Definition at line 52 of file pkt.h.

◆ ~ScopedEnableOptionsCopy()

template<typename PktType>
isc::dhcp::ScopedEnableOptionsCopy< PktType >::~ScopedEnableOptionsCopy ( )
inline

Destructor.

Disables options copying on a packets.

Definition at line 66 of file pkt.h.


The documentation for this class was generated from the following file: