CIDLib Template Functions
Welcome To CIDCorp
Home of the CIDLib Class Libraries


Core Template Functions

These are global template functions that provide a lot of magic and will definitely make your life easier. Be sure to reference them via the global namespace '::' so you don't get burned later if a class provides a method with a same name.
Method Name Header File
::bEnumFlagOn CIDLib_Type.Hpp
This method will test whether a bit represented by an enumeration value is on within another value of that same enumeration type. This makes it type safe, which is nice since enums don't naturally support logical operations on them (i.e. a lot of unsafe casting gets done.)
::c4AdrDiff CIDLib_Type.Hpp
This method will find out how much different there is between two pointers. This saves all of the messy casting to byte pointers and such.
::MakeNewOfType CIDLib_ThisFac.Hpp
This is the dynamic object creation method. Given the mame of a class or the TCIDClass object for a class, a new object of that class will be dynamically allocated and returned. The class must have registered itself with the type registry in order for the class to be dynamically created. This is done by using the STDMEMBERS2 macro instead of the STDMEMBERS macro.
::MaxVal,
::MinVal
CIDLib_Type.Hpp
These are just simple, but type safe, methods to find the smaller or larger of two values. These can be objects if they support the > and < operators.
::PolymorphicRead,
::PolymorphicWrite
CIDLib_Stream.Hpp
These methods are very magical and will polymorphically stream in and out objects that are registered with the type registry. This is an ultra powerful concept and is used to very, very good effect by the CIDLib frameworks.
::pDupObject,
::pDupObjectPtr
CIDLib_Duplicable.Hpp
These methods will polymorphically duplicate an object, passed by reference or by pointer. This, in conjunction with dynamic typing and polymorphic streaming, make for the ultimate in type independent high level code.
::pDupObjArray CIDLib_ObjArray.Hpp
Duplicates an instantiated object of the object array template class, in a type safe way.
::pOffsetPtr CIDLib_Type.Hpp
Offsets a pointer by a given number of bytes, hiding all of the needed casting to a byte pointer and back again.

CIDCorp
Dean Roddey
Internet: droddey@ng.netgate.net
CIS: 72170,1614