home *** CD-ROM | disk | FTP | other *** search
- /* START_LICENSE_HEADER
-
- Copyright (C) 2000 Martin Piper, original design and program code
- Copyright (C) 2001-2005 Replica Software
-
- This program file is copyright (C) Replica Software and can only be used under license.
- For more information visit: http://www.replicanet.com/
- Or email: info@replicanet.com
-
- END_LICENSE_HEADER */
- #ifndef __DATABLOCK_GENERICSTLVIRTUAL_H__
- #define __DATABLOCK_GENERICSTLVIRTUAL_H__
-
- #include "RNReplicaNet/Inc/DataBlock.h"
- #include <map>
-
- /**
- * This class provides, at a generic void* level, element tracking and message handling routines with pure virtual hooks
- * intended for more specific derived container updates.
- */
- class DataBlock_GenericSTLVirtual : public RNReplicaNet::DataBlock
- {
- public:
- DataBlock_GenericSTLVirtual();
-
- virtual ~DataBlock_GenericSTLVirtual();
-
- virtual void Poll(RNReplicaNet::DataBlockReason *reason);
-
- virtual void ParseMessage(RNReplicaNet::MessageHelper *message);
-
- protected:
- virtual int GetNumberOfElements(void) = 0;
-
- virtual void SetNumberOfElements(const int numElements) = 0;
-
- virtual int GetElementSize(void) const = 0;
-
- virtual void *GetElementPointerAt(const int offset) = 0;
-
- virtual void SetElementDataAt(const void *data,const int offset) = 0;
-
- struct SessionBlock
- {
- SessionBlock(int sessid);
-
- virtual ~SessionBlock();
-
- int mSessionID;
-
- int mNumElements;
- void **mOrderedElementData;
- };
-
- // Ctor variables
-
- void *mData;
-
- // Other variables
-
- std::map<int,SessionBlock*> mPerSessionData;
-
- private:
- void DoInitialSettingsFor(SessionBlock *sessionBlock,const int elementSize);
- };
-
- #endif
-