Free Electron
Public Member Functions | Protected Attributes | Private Attributes | List of all members
fe::BaseType Class Referenceabstract

A class to associate functionality with run time types. More...

#include <Type.h>

Inheritance diagram for fe::BaseType:
Inheritance graph
[legend]

Public Member Functions

virtual FE_UWORD size (void) const
 
virtual void assign (void *lvalue, void *rvalue)=0
 
virtual bool equiv (void *a_a, void *a_b)=0
 
virtual void setInfo (const sp< Info > &spInfo)
 
virtual void setInfo (Info *pInfo)
 
virtual sp< Info > getInfo (void)
 
virtual bool getConstruct (void) const
 
virtual void construct (void *instance)
 
virtual void destruct (void *instance)
 
virtual BWORD copy (void *instance, const void *source)
 
virtual TypeInfotypeinfo (void)
 
virtual sp< BaseTypeVector > createVector (void)=0
 
const String verboseName (void) const
 
virtual const Stringname (void) const
 
void setName (const String &a_name)
 
- Public Member Functions inherited from fe::Counted
virtual void acquire (void)
 Increment the reference count. More...
 
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void release (void)
 Decrement the reference count. More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 

Protected Attributes

FE_UWORD m_size
 
sp< Info > m_spInfo
 
TypeInfo m_typeInfo
 

Private Attributes

String m_storedName
 

Additional Inherited Members

- Static Public Member Functions inherited from fe::Counted
static String reportTracker (void)
 
static U32 trackerCount (void)
 
- Protected Member Functions inherited from fe::Counted
int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 

Detailed Description

A class to associate functionality with run time types.

The primary purpose of this class is to associate functionaility such as serialization, construction, and destruction with library/application managed instances of C++ types.

This is done by creating a BaseType, typically by using the Type template class through TypeMaster. The necessary functionality is associated by creating a BaseType::Info object and attaching it to the BaseType.

class Info32 : public BaseType::Info
{
virtual void output(std::ostream &ostrm, void *instance, t_serialMode mode)
{
U32 u32;
u32 = htonl(*(U32 *)instance);
ostrm.write((char *)&u32, sizeof(U32));
}
virtual void input(std::istream &istrm, void *instance, t_serialMode mode)
{
U32 u32;
istrm.read((char *)&u32, sizeof(U32));
*(U32 *)instance = ntohl(u32);
}
virtual IWORD iosize(void) { return sizeof(U32); }
};
sp<BaseType> spT;
spT = typeMaster->assertType<U32>("unsigned_integer");
spT->setInfo(new Info32());

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