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

#include <extensible.h>

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

Public Member Functions

 BoolExtItem (Module *owner, const std::string &key, ExtensibleType exttype, bool sync=false)
 
void Delete (Extensible *container, void *item) override
 
void FromInternal (Extensible *container, const std::string &value) noexcept override
 
void FromNetwork (Extensible *container, const std::string &value) noexcept override
 
std::string ToHuman (const Extensible *container, void *item) const noexcept override
 
std::string ToInternal (const Extensible *container, void *item) const noexcept override
 
std::string ToNetwork (const Extensible *container, void *item) const noexcept override
 
bool Get (const Extensible *container) const
 
void Set (Extensible *container, bool sync=true)
 
void Unset (Extensible *container, bool sync=true)
 
- Public Member Functions inherited from ExtensionItem
 ExtensionItem (Module *owner, const std::string &key, ExtensibleType exttype)
 
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 boolean value.

Constructor & Destructor Documentation

◆ BoolExtItem()

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

Initializes an instance of the BoolExtItem class.

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

Member Function Documentation

◆ Delete()

void BoolExtItem::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 BoolExtItem::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 BoolExtItem::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()

bool BoolExtItem::Get ( const Extensible container) const

Retrieves the value for this BoolExtItem.

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

◆ Set()

void BoolExtItem::Set ( Extensible container,
bool  sync = true 
)

Sets a value for this BoolExtItem.

Parameters
containerA container that the BoolExtItem should be set on.
syncWhether to sync this set to the network.

◆ ToHuman()

std::string BoolExtItem::ToHuman ( const Extensible container,
void *  item 
) const
overridevirtualnoexcept

Gets an ExtensionItem's value in a human-readable format.

Parameters
containerThe container the ExtensionItem is set on.
itemThe value to convert to a human-readable format.
Returns
The value specified in item in a human readable format.

Reimplemented from ExtensionItem.

◆ ToInternal()

std::string BoolExtItem::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 BoolExtItem::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 BoolExtItem::Unset ( Extensible container,
bool  sync = true 
)

Removes the value for this BoolExtItem.

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

Member Data Documentation

◆ synced

bool BoolExtItem::synced
protected

Whether to sync this BoolExtItem across the network.


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