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

#include <extensible.h>

Inheritance diagram for StringExtItem:
SimpleExtItem< std::string > ExtensionItem ServiceProvider Cullable insp::uncopiable

Public Member Functions

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

Constructor & Destructor Documentation

◆ StringExtItem()

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

Initializes an instance of the StringExtItem class.

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

Member Function Documentation

◆ FromInternal()

void StringExtItem::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 StringExtItem::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.

◆ ToInternal()

std::string StringExtItem::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 StringExtItem::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.

Member Data Documentation

◆ synced

bool StringExtItem::synced
protected

Whether to sync this StringExtItem across the network.


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