InspIRCd  4.0
Public Member Functions | Protected Attributes | List of all members
IntExtItem Class Reference

#include <extensible.h>

Inheritance diagram for IntExtItem:
ExtensionItem ServiceProvider Cullable insp::uncopiable

Public Member Functions

 IntExtItem (Module *owner, const std::string &key, ExtensibleType exttype, bool sync=false)
 
void Delete (Extensible *container, void *item) override
 
intptr_t Get (const Extensible *container) const
 
void FromInternal (Extensible *container, const std::string &value) noexcept override
 
void FromNetwork (Extensible *container, const std::string &value) noexcept override
 
void Set (Extensible *container, intptr_t value, bool sync=true)
 
std::string ToInternal (const Extensible *container, void *item) const noexcept override
 
std::string ToNetwork (const Extensible *container, void *item) const noexcept override
 
void Unset (Extensible *container, bool sync=true)
 
- Public Member Functions inherited from ExtensionItem
 ExtensionItem (Module *owner, const std::string &key, ExtensibleType exttype)
 
virtual std::string ToHuman (const Extensible *container, void *item) const noexcept
 
void RegisterService () override
 
- Public Member Functions inherited from ServiceProvider
 ServiceProvider (Module *Creator, const std::string &Name, ServiceType Type)
 
const char * GetTypeString () const
 
void DisableAutoRegister ()
 
- Public Member Functions inherited from Cullable
virtual ~Cullable ()
 
virtual Result Cull ()
 

Protected Attributes

bool synced
 

Additional Inherited Members

- Public Types inherited from ExtensionItem
enum  ExtensibleType { EXT_USER , EXT_CHANNEL , EXT_MEMBERSHIP }
 
- Public Attributes inherited from ExtensionItem
const ExtensibleType type
 
- Public Attributes inherited from ServiceProvider
ModuleRef creator
 
const std::string name
 
const ServiceType service
 
- Protected Member Functions inherited from ExtensionItem
void * GetRaw (const Extensible *container) const
 
void * SetRaw (Extensible *container, void *value)
 
void * UnsetRaw (Extensible *container)
 
void Sync (const Extensible *container, void *item)
 
- Protected Member Functions inherited from Cullable
 Cullable ()
 

Detailed Description

Encapsulates an ExtensionItem which has a integer value.

Constructor & Destructor Documentation

◆ IntExtItem()

IntExtItem::IntExtItem ( Module owner,
const std::string &  key,
ExtensibleType  exttype,
bool  sync = false 
)

Initializes an instance of the IntExtItem class.

Parameters
ownerThe module which created this IntExtItem.
keyThe name of the extension item (e.g. ssl_cert).
exttypeThe type of Extensible that this IntExtItem applies to.
syncWhether this IntExtItem should be broadcast to other servers.

Member Function Documentation

◆ Delete()

void IntExtItem::Delete ( Extensible container,
void *  item 
)
overridevirtual

Deallocates the specified ExtensionItem value.

Parameters
containerThe container that the ExtensionItem is set on.
itemThe item to deallocate.

Implements ExtensionItem.

◆ FromInternal()

void IntExtItem::FromInternal ( Extensible container,
const std::string &  value 
)
overridevirtualnoexcept

Sets an ExtensionItem using a value in the internal format.

Parameters
containerA container the ExtensionItem should be set on.
valueA value in the internal format.

Reimplemented from ExtensionItem.

◆ FromNetwork()

void IntExtItem::FromNetwork ( Extensible container,
const std::string &  value 
)
overridevirtualnoexcept

Sets an ExtensionItem using a value in the network format.

Parameters
containerA container the ExtensionItem should be set on.
valueA value in the network format.

Reimplemented from ExtensionItem.

◆ Get()

intptr_t IntExtItem::Get ( const Extensible container) const

Retrieves the value for this IntExtItem.

Parameters
containerThe container that the IntExtItem is set on.
Returns
Either the value of this IntExtItem or NULL if it is not set.

◆ Set()

void IntExtItem::Set ( Extensible container,
intptr_t  value,
bool  sync = true 
)

Sets a value for this IntExtItem.

Parameters
containerA container that the IntExtItem should be set on.
valueThe new value for this IntExtItem.
syncWhether to sync this value to other servers.

◆ ToInternal()

std::string IntExtItem::ToInternal ( const Extensible container,
void *  item 
) const
overridevirtualnoexcept

Gets an ExtensionItem's value in the internal format.

Parameters
containerThe container the ExtensionItem is set on.
itemThe value to convert to the internal format.
Returns
The value specified in item in the internal format.

Reimplemented from ExtensionItem.

◆ ToNetwork()

std::string IntExtItem::ToNetwork ( const Extensible container,
void *  item 
) const
overridevirtualnoexcept

Gets an ExtensionItem's value in the network format.

Parameters
containerThe container the ExtensionItem is set on.
itemThe value to convert to the network format.
Returns
The value specified in item in the network format.

Reimplemented from ExtensionItem.

◆ Unset()

void IntExtItem::Unset ( Extensible container,
bool  sync = true 
)

Removes the value for this IntExtItem.

Parameters
containerA container the ExtensionItem should be removed from.
syncWhether to sync this unset to the network.

Member Data Documentation

◆ synced

bool IntExtItem::synced
protected

Whether to sync this IntExtItem across the network.


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