InspIRCd  3.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
ExtensionItem Class Referenceabstract

#include <extensible.h>

Inheritance diagram for ExtensionItem:
ServiceProvider usecountbase classbase LocalExtItem StringExtItem LocalIntExt SimpleExtItem< T, Del > SimpleExtItem< ChanData > SimpleExtItem< std::string > LocalStringExt

Public Types

enum  ExtensibleType { EXT_USER, EXT_CHANNEL, EXT_MEMBERSHIP }
 

Public Member Functions

 ExtensionItem (const std::string &key, ExtensibleType exttype, Module *owner)
 
virtual std::string serialize (SerializeFormat format, const Extensible *container, void *item) const =0
 
virtual void unserialize (SerializeFormat format, Extensible *container, const std::string &value)=0
 
virtual void free (void *item)=0
 
void RegisterService () CXX11_OVERRIDE
 
- Public Member Functions inherited from ServiceProvider
 ServiceProvider (Module *Creator, const std::string &Name, ServiceType Type)
 
void DisableAutoRegister ()
 
- Public Member Functions inherited from classbase
virtual CullResult cull ()
 
- Public Member Functions inherited from usecountbase
unsigned int GetUseCount () const
 
void refcount_inc () const
 
bool refcount_dec () const
 

Public Attributes

const ExtensibleType type
 
- Public Attributes inherited from ServiceProvider
ModuleRef creator
 
const std::string name
 
const ServiceType service
 

Protected Member Functions

void * get_raw (const Extensible *container) const
 
void * set_raw (Extensible *container, void *value)
 
void * unset_raw (Extensible *container)
 

Detailed Description

Class represnting an extension of some object

Member Enumeration Documentation

◆ ExtensibleType

Extensible subclasses

Member Function Documentation

◆ free()

virtual void ExtensionItem::free ( void *  item)
pure virtual

◆ get_raw()

void * ExtensionItem::get_raw ( const Extensible container) const
protected

Get the item from the internal map

◆ RegisterService()

void ExtensionItem::RegisterService ( )
virtual

Register this object in the ExtensionManager

Reimplemented from ServiceProvider.

◆ serialize()

virtual std::string ExtensionItem::serialize ( SerializeFormat  format,
const Extensible container,
void *  item 
) const
pure virtual

Serialize this item into a string

Parameters
formatThe format to serialize to
containerThe object containing this item
itemThe item itself

Implemented in StringExtItem, LocalIntExt, LocalStringExt, and LocalExtItem.

◆ set_raw()

void * ExtensionItem::set_raw ( Extensible container,
void *  value 
)
protected

Set the item in the internal map; returns old value

◆ unserialize()

virtual void ExtensionItem::unserialize ( SerializeFormat  format,
Extensible container,
const std::string &  value 
)
pure virtual

Convert the string form back into an item

Parameters
formatThe format to serialize from (not FORMAT_USER)
containerThe object that this item applies to
valueThe return from a serialize() call that was run elsewhere with this key

Implemented in StringExtItem, LocalIntExt, LocalStringExt, and LocalExtItem.

◆ unset_raw()

void * ExtensionItem::unset_raw ( Extensible container)
protected

Remove the item from the internal map; returns old value

Member Data Documentation

◆ type

const ExtensibleType ExtensionItem::type

Type (subclass) of Extensible that this ExtensionItem is valid for


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