Anope IRC Services  Version 2.0
Public Member Functions | Static Public Member Functions | Data Fields | Private Types | Private Attributes | Static Private Attributes
Serialize Class Reference

#include <serialize.h>

Inheritance diagram for Serialize:
Inheritance graph
[legend]
Collaboration diagram for Serialize:
Collaboration graph
[legend]

Public Member Functions

 Type (const Anope::string &n, unserialize_func f, Module *owner=NULL)
 
 ~Type ()
 
const Anope::stringGetName ()
 
SerializableUnserialize (Serializable *obj, Serialize::Data &data)
 
void Check ()
 
time_t GetTimestamp () const
 
void UpdateTimestamp ()
 
ModuleGetOwner () const
 

Static Public Member Functions

static Serialize::TypeFind (const Anope::string &name)
 
static const std::vector
< Anope::string > & 
GetTypeOrder ()
 
static const std::map
< Anope::string,
Serialize::Type * > & 
GetTypes ()
 

Data Fields

std::map< uint64_t,
Serializable * > 
objects
 

Private Types

typedef Serializable *(* unserialize_func )(Serializable *obj, Serialize::Data &)
 

Private Attributes

Anope::string name
 
unserialize_func unserialize
 
Moduleowner
 
time_t timestamp
 

Static Private Attributes

static std::vector< Anope::stringTypeOrder
 
static std::map< Anope::string,
Serialize::Type * > 
Types
 

Detailed Description

Definition at line 112 of file serialize.h.

Member Typedef Documentation

typedef Serializable*(* Serialize::unserialize_func)(Serializable *obj, Serialize::Data &)
private

Definition at line 114 of file serialize.h.

Constructor & Destructor Documentation

Serialize::~Type ( )

Member Function Documentation

void Serialize::Check ( )

Check if this object type has any pending changes and update them.

static Serialize::Type* Serialize::Find ( const Anope::string name)
static
const Anope::string& Serialize::GetName ( )
inline

Gets the name for this type

Returns
The name, eg "NickAlias"

Definition at line 148 of file serialize.h.

References name.

Module* Serialize::GetOwner ( ) const
inline

Definition at line 171 of file serialize.h.

time_t Serialize::GetTimestamp ( ) const

Gets the timestamp for the object type. That is, the time we know all objects of this type are updated at least to.

static const std::vector<Anope::string>& Serialize::GetTypeOrder ( )
static
static const std::map<Anope::string, Serialize::Type *>& Serialize::GetTypes ( )
static
Serialize::Type ( const Anope::string n,
unserialize_func  f,
Module owner = NULL 
)
Serializable* Serialize::Unserialize ( Serializable obj,
Serialize::Data data 
)

Unserialized an object.

Parameters
objNULL if this object doesn't yet exist. If this isn't NULL, instead update the contents of this object.
dataThe data to unserialize
Returns
The unserialized object. If obj != NULL this should be obj.
void Serialize::UpdateTimestamp ( )

Bumps object type timestamp to current time

Field Documentation

Anope::string Serialize::name
private

Definition at line 120 of file serialize.h.

std::map<uint64_t, Serializable *> Serialize::objects

Definition at line 135 of file serialize.h.

Module* Serialize::owner
private

Definition at line 125 of file serialize.h.

time_t Serialize::timestamp
private

Definition at line 131 of file serialize.h.

std::vector<Anope::string> Serialize::TypeOrder
staticprivate

Definition at line 116 of file serialize.h.

std::map<Anope::string, Serialize::Type *> Serialize::Types
staticprivate

Definition at line 117 of file serialize.h.

unserialize_func Serialize::unserialize
private

Definition at line 121 of file serialize.h.


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