protlib::IEManager Class Reference
[Information Elements]

#include <source/ariba/utility/transport/tcpip/protlib/ie.h>

List of all members.

Public Member Functions

virtual ~IEManager ()
virtual void register_ie (const IE *ie)
virtual void register_ie (uint16 category, uint16 type, uint16 subtype, const IE *ie)
virtual IEnew_instance (uint16 category, uint16 type, uint16 subtype)
virtual void serialize (IE &ie, NetMsg &msg, IE::coding_t coding, uint32 &bytes_written) const
virtual IEdeserialize (NetMsg &msg, uint16 category, IE::coding_t coding, IEErrorList &errorlist, uint32 &bytes_read, bool skip=true)=0

Protected Member Functions

 IEManager ()
virtual IElookup_ie (uint16 category, uint16 type, uint16 subtype)
virtual void throw_nomem_error () const

Private Types

typedef hash_map< IE_Key, IE
*, hash_IE_Key
category_map_t

Private Attributes

category_map_t registry


Detailed Description

A registry and factory for IEs.

Each IE has to register at the IE Manager. The IEManager then provides methods to deserialize IEs from or serialize IEs to a NetMsg object. IEManager is abstract and thus can't be instantiated.

In contrast to earlier implementations, IEManager itself is no longer a singleton. Inheriting from singletons is a tricky business in C++ (and much easier in Java) because static methods can't be virtual. Because of this, multiple badly implemented child classes were unable to coexist in a single program.

The following has to be done in each protocol to use IEManager and create a protocol-specific singleton (called PROT_IEManager):

An example implementation can be found in the QSPEC code. Please note that old code (r286 and earlier) won't compile because of interface changes. The ability to register "default" IEs that are returned if no more specific IE is found has been removed because it depended on coding_t. If derived IEManagers need this functionality, they have to override lookup_ie().

Definition at line 439 of file ie.h.


Member Typedef Documentation

typedef hash_map<IE_Key, IE *, hash_IE_Key> protlib::IEManager::category_map_t [private]

Definition at line 465 of file ie.h.


Member Function Documentation

virtual IE* protlib::IEManager::deserialize ( NetMsg msg,
uint16  category,
IE::coding_t  coding,
IEErrorList errorlist,
uint32 bytes_read,
bool  skip = true 
) [pure virtual]


Member Data Documentation

Definition at line 467 of file ie.h.

Referenced by lookup_ie(), register_ie(), and ~IEManager().


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

Generated on Fri Aug 14 23:39:52 2009 for Ariba by  doxygen 1.5.8