Platform: Platform Index Page

Platform Index Page

1

Introduction

This sections contains documentation about the RNPlatform include files.
Generated on Sun Oct 30 01:12:31 2005 for Platform by doxygen 1.4.1


Platform: File Index

Platform File List

Here is a list of all documented files with brief descriptions:
CheckSum.h [code]
ClassReg.h [code]
CThreadClass.h [code]
Database.h [code]
DatabaseManager.h [code]
DLLExportAPI.h [code]
Encryption.h [code]
FreewareCode.h [code]
MemoryTracking.h [code]
MessageHelper.h [code]
PlatformHeap.h [code]
PlatformInfo.h [code]
RegistryManager.h [code]
RegistryManagerList.h [code]
RegistryManagerMap.h [code]
SysTime.h [code]
Thread.h [code]
ThreadClass.h [code]


Platform: Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
RNReplicaNet::Checksum
RNReplicaNet::DatabaseManager< T >
RNReplicaNet::Encryption
RNReplicaNet::LockingMechanism
RNReplicaNet::MessageHelper
RNReplicaNet::MutexClass
RNReplicaNet::PlatformHeap
RNReplicaNet::PlatformHeapBlock
RNReplicaNet::PlatformInfo
RNReplicaNet::RegistryManager< T >
RNReplicaNet::RegistryManagerList< T >
RNReplicaNet::RegistryManagerMap< I, T, C >
RNReplicaNet::SysTime
RNReplicaNet::Thread
RNReplicaNet::ThreadClass


Platform: RNReplicaNet::Checksum Class Reference

RNReplicaNet::Checksum

RNReplicaNet::Checksum Class Reference

#include <CheckSum.h>

List of all members.

Static Public Member Functions

static int ChecksumData (const char *buffer, const int length)

Detailed Description

This class handles simple checking of data blocks

Member Function Documentation

static int RNReplicaNet::Checksum::ChecksumData | ( | const char * | buffer,
 |  | const int | length
 | ) | [static]

Performs a simple and quick checksum of a buffer

Parameters:
buffer | the data buffer to checksum
the | length of the data buffer in bytes
Returns:
the checksum for the data, the checksum returned is never 0

The documentation for this class was generated from the following file:
  • CheckSum.h


Platform: RNReplicaNet::DatabaseManager< T > Class Template Reference

RNReplicaNet::DatabaseManager

RNReplicaNet::DatabaseManager< T > Class Template Reference

#include <DatabaseManager.h>

List of all members.

Public Member Functions

DatabaseManager ()
virtual | ~DatabaseManager ()
T * | AddItem (T *item)
T * | AddItemHead (T *item)
void | RemoveItem (T *item)
void | RemoveItem (void)
void | BeginIterate (void)
void | EndIterate (void)
T * | Iterate (void)
T * | FindItem (void *keyData)
int | Tidy (void)
void | SetEnableFastFind (bool enable=false)
void | SetHashFromDataFunc (t_HashFromDataFunc *pfunc)
void | SetHashFromKeyFunc (t_HashFromKeyFunc *pfunc)
void | SetCompareDataWithKeyFunc (t_CompareDataWithKeyFunc *pfunc)

Detailed Description

template<class T>
class RNReplicaNet::DatabaseManager< T >

DatabaseManager is a template class for handling classes in an organised and quick database

Constructor & Destructor Documentation

template<class T>
RNReplicaNet::DatabaseManager< T >::DatabaseManager ( ) [inline]

The ctor performs some basic initialisation

template<class T>
virtual RNReplicaNet::DatabaseManager< T >::~DatabaseManager ( ) [inline, virtual]

The dtor makes sure everything is tidy

Member Function Documentation

template<class T>
T* RNReplicaNet::DatabaseManager< T >::AddItem ( T * item ) [inline]

Adds an item pointer to the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

template<class T>
void RNReplicaNet::DatabaseManager< T >::BeginIterate ( void ) [inline]

Starts the iteration of the items in the list from the start and works forwards

template<class T>
void RNReplicaNet::DatabaseManager< T >::EndIterate ( void ) [inline]

Starts the iteration of the items in the list from the end and works backwards

template<class T>
T* RNReplicaNet::DatabaseManager< T >::FindItem ( void * keyData ) [inline]

This finds an item using the t_CompareDataWithKeyFunc as a callback. If the fast find algorithm is used then the t_HashFromKeyFunc is also used

Parameters:
keyData a pointer to key data to search for

template<class T>
T* RNReplicaNet::DatabaseManager< T >::Iterate ( void ) [inline]

Iterates through the items in the list

Returns:
returns the next item pointer in the list or returns NULL for the end of the list

template<class T>
void RNReplicaNet::DatabaseManager< T >::RemoveItem ( void ) [inline]

Removes the current iterated item but does not free the item as this is left to the user to do

template<class T>
void RNReplicaNet::DatabaseManager< T >::RemoveItem ( T * item ) [inline]

Removes an item pointer from the list but does not free the item as this is left to the user to do

Parameters:
item the item pointer to remove

template<class T>
void RNReplicaNet::DatabaseManager< T >::SetEnableFastFind ( bool enable = false ) [inline]

A speed enhancement for the database is to turn on the fast find algorithm. This algorithm uses several data hashing functions defined by the user that are then used to index the data.

Parameters:
enable set this to be true to enable the fast indexing algorithm. The default is false

The documentation for this class was generated from the following file:
  • DatabaseManager.h


Platform: RNReplicaNet::Encryption Class Reference

RNReplicaNet::Encryption

RNReplicaNet::Encryption Class Reference

#include <Encryption.h>

List of all members.

Static Public Member Functions

static void | Encrypt (void *data, int length, Key *key)
static void | Decrypt (void *data, int length, Key *key)

Classes

struct | Key

Detailed Description

An encryption class that is designed to be fast and maintain the size of the original data.

Member Function Documentation

static void RNReplicaNet::Encryption::Decrypt | ( | void * | data,
 |  | int | length,
 |  | Key * | key
 | ) | [static]

Decrypt a portion of memory with a key.

Parameters:
data | the pointer to the start of the memory
length | the length of the memory in bytes
key | the key to use

static void RNReplicaNet::Encryption::Encrypt | ( | void * | data,
 |  | int | length,
 |  | Key * | key
 | ) | [static]

Encrypt a portion of memory with a key.

Parameters:
data | the pointer to the start of the memory
length | the length of the memory in bytes
key | the key to use

The documentation for this class was generated from the following file:
  • Encryption.h


Platform: RNReplicaNet::LockingMechanism Class Reference

RNReplicaNet::LockingMechanism

RNReplicaNet::LockingMechanism Class Reference

#include <ThreadClass.h>

Collaboration diagram for RNReplicaNet::LockingMechanism:

[legend]
List of all members.

Public Member Functions

LockingMechanism (MutexClass *lockee)
virtual ~LockingMechanism ()

Detailed Description

A simple class that handles locking of a class via the MutexClass

Constructor & Destructor Documentation

RNReplicaNet::LockingMechanism::LockingMechanism ( MutexClass * lockee ) [inline]

This begins the lock of the class

Parameters:
lockee A pointer to the class to lock, that inherits from MutexClass

virtual RNReplicaNet::LockingMechanism::~LockingMechanism ( ) [inline, virtual]

The dtor unlocks the class automatically

The documentation for this class was generated from the following file:
  • ThreadClass.h
Generated on Sun Oct 30 01:12:34 2005 for Platform by doxygen 1.4.1


Platform: RNReplicaNet::MessageHelper Class Reference

RNReplicaNet::MessageHelper

RNReplicaNet::MessageHelper Class Reference

#include <MessageHelper.h>

List of all members.

Public Member Functions

MessageHelper ()
virtual | ~MessageHelper ()
void | SetBuffer (void *const buffer)
void | AddVariable (const void *variable, const int size)
void | AddData (const void *data, const int size)
void | GetVariable (void *const variable, const int size)
void | GetData (void *const data, const int size)
int | GetSize (void)
void | SetSize (const int size)
void | AddInteger (const int value)
void | AddFloat (const float value)
int | GetInteger (void)
float | GetFloat (void)

Static Public Member Functions

static std::string | DumpAsHex (const void *data, const int size)

Detailed Description

A simple message helper class that helps to construct and deconstruct sequences of variables. This routine is endian safe and should be used where data needs to be endian safe

Constructor & Destructor Documentation

RNReplicaNet::MessageHelper::MessageHelper ( )

The ctor performs some basic initialisation

virtual RNReplicaNet::MessageHelper::~MessageHelper ( ) [virtual]

The dtor makes sure everything is tidy

Member Function Documentation

void RNReplicaNet::MessageHelper::AddData | ( | const void * | data,
 |  | const int | size
 | ) |

Adds a data block of a specified size to the message buffer without using any endian checking

Parameters:
data | the pointer to the data
size | the size of the data

void RNReplicaNet::MessageHelper::AddFloat ( const float value )

Adds a float to the message buffer

Parameters:
value the value to add

void RNReplicaNet::MessageHelper::AddInteger ( const int value )

Adds an integer to the message buffer

Parameters:
value the value to add

void RNReplicaNet::MessageHelper::AddVariable | ( | const void * | variable,
 |  | const int | size
 | ) |

Adds a variable of a specified size to the message buffer while using an endian check to preserve the value between platforms with different endian formats

Parameters:
variable | the pointer to the variable
size | the size of the data

static std::string RNReplicaNet::MessageHelper::DumpAsHex | ( | const void * | data,
 |  | const int | size
 | ) | [static]

This produces a hex dump of any length of data

void RNReplicaNet::MessageHelper::GetData | ( | void *const | data,
 |  | const int | size
 | ) |

Gets data of a specified size from the message buffer

Parameters:
data | the pointer to the data
size | the size of the data

float RNReplicaNet::MessageHelper::GetFloat ( void )

Gets a float from the message buffer

Parameters:
value the value to get

int RNReplicaNet::MessageHelper::GetInteger ( void )

Gets an integer from the message buffer

Parameters:
value the value to get

int RNReplicaNet::MessageHelper::GetSize ( void )

Returns the current size of the message in bytes

Returns:
returns the size of the message buffer in bytes

void RNReplicaNet::MessageHelper::GetVariable | ( | void *const | variable,
 |  | const int | size
 | ) |

Gets a variable of a specified size from the message buffer

Parameters:
variable | the pointer to the variable
size | the size of the data

void RNReplicaNet::MessageHelper::SetBuffer ( void *const buffer )

Sets the data buffer pointer to use while constructing or deconstructing this message. This also causes the length of the buffer to revert to zero.

Parameters:
buffer the buffer pointer to set

void RNReplicaNet::MessageHelper::SetSize ( const int size )

Sets the current size of the message in bytes

Parameters:
the size of the message in bytes

The documentation for this class was generated from the following file:
  • MessageHelper.h


Platform: RNReplicaNet::MutexClass Class Reference

RNReplicaNet::MutexClass

RNReplicaNet::MutexClass Class Reference

#include <ThreadClass.h>

Inheritance diagram for RNReplicaNet::MutexClass:

[legend]
List of all members.

Public Types

enum | { kNoOwnerThread = -1 }

Public Member Functions

MutexClass ()
virtual | ~MutexClass ()
void | Lock (void)
void | UnLock (void)

Detailed Description

Creates a mutex object and controls access to the class and related derived classes

Constructor & Destructor Documentation

RNReplicaNet::MutexClass::MutexClass ( )

The ctor performs some basic initialisation

virtual RNReplicaNet::MutexClass::~MutexClass ( ) [virtual]

The dtor makes sure everything is tidy

Member Function Documentation

void RNReplicaNet::MutexClass::Lock ( void )

Tries to lock access to this class. The lock with block until it is able to succeed

void RNReplicaNet::MutexClass::UnLock ( void )

Unlocks access to this class

The documentation for this class was generated from the following file:
  • ThreadClass.h
Generated on Sun Oct 30 01:12:33 2005 for Platform by doxygen 1.4.1


Platform: RNReplicaNet::PlatformHeap Class Reference

RNReplicaNet::PlatformHeap

RNReplicaNet::PlatformHeap Class Reference

#include <PlatformHeap.h>

List of all members.

Static Public Member Functions

static void ForceFree (void)

Detailed Description

This class uses a list of PlatformHeapBlock classes to make sure that all blocks of memory are registered for destruction when PlatformHeap::ForceFree() is called. Each PlatformHeapBlock class is destructed in the reverse order they were added to the stack, it is a LIFO stack. This class can be used to make sure shutdown functions are called and pointers properly cleared.

Member Function Documentation

static void RNReplicaNet::PlatformHeap::ForceFree ( void ) [static]

Deletes all heap blocks on the stack in reverse order. This should only be called when all threads accessing memory registered using this class are stopped.

The documentation for this class was generated from the following file:
  • PlatformHeap.h


Platform: RNReplicaNet::PlatformHeapBlock Class Reference

RNReplicaNet::PlatformHeapBlock

RNReplicaNet::PlatformHeapBlock Class Reference

#include <PlatformHeap.h>

List of all members.

Public Member Functions

PlatformHeapBlock ()
virtual | ~PlatformHeapBlock ()
void | Register (void)

Detailed Description

This base class is used for maintaining blocks of memory

Constructor & Destructor Documentation

RNReplicaNet::PlatformHeapBlock::PlatformHeapBlock ( )

This ctor does nothing exciting

virtual RNReplicaNet::PlatformHeapBlock::~PlatformHeapBlock ( ) [virtual]

This dtor self removes from PlatformHeap

Member Function Documentation

void RNReplicaNet::PlatformHeapBlock::Register ( void )

This self registers with PlatformHeap

The documentation for this class was generated from the following file:
  • PlatformHeap.h


Platform: RNReplicaNet::PlatformInfo Class Reference

RNReplicaNet::PlatformInfo

RNReplicaNet::PlatformInfo Class Reference

#include <PlatformInfo.h>

List of all members.

Static Public Member Functions

static bool | IsThreaded (void)
static bool | IsLittleEndian (void)
static void | SetThreaded (const bool allow)

Detailed Description

A class designed to read various platform specific attributes

Member Function Documentation

static bool RNReplicaNet::PlatformInfo::IsLittleEndian ( void ) [static]

Tests for endianness of the machine

Returns:
returns true for little endian machines

static bool RNReplicaNet::PlatformInfo::IsThreaded ( void ) [static]

Supplies information on if the library is compiled with threading on or off.

Returns:
returns true if threading is turned on

static void RNReplicaNet::PlatformInfo::SetThreaded ( const bool allow ) [static]

Sets if threads are allowed on this system. Allowing threads with single threaded libraries may result in unexpected results.

Parameters:
allow true means allow threads, false does not allow threads

The documentation for this class was generated from the following file:
  • PlatformInfo.h


Platform: RNReplicaNet::RegistryManager< T > Class Template Reference

RNReplicaNet::RegistryManager

RNReplicaNet::RegistryManager< T > Class Template Reference

#include <RegistryManager.h>

List of all members.

Public Member Functions

RegistryManager ()
virtual | ~RegistryManager ()
void | AddItem (T *item)
void | RemoveItem (T *item)
void | RemoveItem (void)
void | BeginIterate (void)
T * | Iterate (void)

Detailed Description

template<class T>
class RNReplicaNet::RegistryManager< T >

RegistryManager is a template class for handling classes in organised vector arrays

Constructor & Destructor Documentation

template<class T>
RNReplicaNet::RegistryManager< T >::RegistryManager ( ) [inline]

The ctor performs some basic initialisation

template<class T>
virtual RNReplicaNet::RegistryManager< T >::~RegistryManager ( ) [inline, virtual]

The dtor makes sure everything is tidy

Member Function Documentation

template<class T>
void RNReplicaNet::RegistryManager< T >::AddItem ( T * item ) [inline]

Adds an item to the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

template<class T>
void RNReplicaNet::RegistryManager< T >::BeginIterate ( void ) [inline]

Starts the iteration of the items in the list

template<class T>
T* RNReplicaNet::RegistryManager< T >::Iterate ( void ) [inline]

Iterates through the items in the list

Returns:
returns the next item pointer in the list or returns NULL for the end of the list

template<class T>
void RNReplicaNet::RegistryManager< T >::RemoveItem ( void ) [inline]

Removes the current iterated item

template<class T>
void RNReplicaNet::RegistryManager< T >::RemoveItem ( T * item ) [inline]

Removes an item from the list but does not free the item as this is left to the user to do

Parameters:
item the item pointer to remove

The documentation for this class was generated from the following file:
  • RegistryManager.h


Platform: RNReplicaNet::RegistryManagerList< T > Class Template Reference

RNReplicaNet::RegistryManagerList

RNReplicaNet::RegistryManagerList< T > Class Template Reference

#include <RegistryManagerList.h>

List of all members.

Public Types

enum | Direction { kForward = 0, kBackward, kUndefined }

Public Member Functions

RegistryManagerList ()
virtual | ~RegistryManagerList ()
void | AddItem (T *item)
void | AddItemHead (T *item)
void | RemoveItem (T *item)
void | RemoveItem (void)
void | BeginIterate (void)
void | EndIterate (void)
T * | Iterate (void)

Detailed Description

template<class T>
class RNReplicaNet::RegistryManagerList< T >

RegistryManager is a template class for handling classes in organised linked lists

Constructor & Destructor Documentation

template<class T>
RNReplicaNet::RegistryManagerList< T >::RegistryManagerList ( ) [inline]

The ctor performs some basic initialisation

template<class T>
virtual RNReplicaNet::RegistryManagerList< T >::~RegistryManagerList ( ) [inline, virtual]

The dtor makes sure everything is tidy

Member Function Documentation

template<class T>
void RNReplicaNet::RegistryManagerList< T >::AddItem ( T * item ) [inline]

Adds an item to the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

template<class T>
void RNReplicaNet::RegistryManagerList< T >::AddItemHead ( T * item ) [inline]

Adds an item to the head of the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

template<class T>
void RNReplicaNet::RegistryManagerList< T >::BeginIterate ( void ) [inline]

Starts the iteration of the items in the list from the start and works forwards

template<class T>
void RNReplicaNet::RegistryManagerList< T >::EndIterate ( void ) [inline]

Starts the iteration of the items in the list from the end and works backwards

template<class T>
T* RNReplicaNet::RegistryManagerList< T >::Iterate ( void ) [inline]

Iterates through the items in the list

Returns:
returns the next item pointer in the list or returns NULL for the end of the list

template<class T>
void RNReplicaNet::RegistryManagerList< T >::RemoveItem ( void ) [inline]

Removes the current iterated item

template<class T>
void RNReplicaNet::RegistryManagerList< T >::RemoveItem ( T * item ) [inline]

Removes an item from the list but does not free the item as this is left to the user to do

Parameters:
item the item pointer to remove

The documentation for this class was generated from the following file:
  • RegistryManagerList.h


Platform: RNReplicaNet::RegistryManagerMap< I, T, C > Class Template Reference

RNReplicaNet::RegistryManagerMap

RNReplicaNet::RegistryManagerMap< I, T, C > Class Template Reference

#include <RegistryManagerMap.h>

List of all members.

Public Types

enum | Direction { kForward = 0, kBackward, kUndefined }

Public Member Functions

RegistryManagerMap ()
virtual | ~RegistryManagerMap ()
bool | AddItem (const I &index, const T *item)
T * | FindItem (const I &index)
bool | RemoveItem (const I &index)
void | RemoveItem (void)
void | BeginIterate (void)
void | EndIterate (void)
T * | Iterate (void)

Detailed Description

template<class I, class T, class C = std::less<I>>
class RNReplicaNet::RegistryManagerMap< I, T, C >

RegistryManager is a template class for handling classes in organised maps

Constructor & Destructor Documentation

template<class I, class T, class C = std::less<I>>
RNReplicaNet::RegistryManagerMap< I, T, C >::RegistryManagerMap ( ) [inline]

The ctor performs some basic initialisation

template<class I, class T, class C = std::less<I>>
virtual RNReplicaNet::RegistryManagerMap< I, T, C >::~RegistryManagerMap ( ) [inline, virtual]

The dtor makes sure everything is tidy

Member Function Documentation

template<class I, class T, class C = std::less<I>>
bool RNReplicaNet::RegistryManagerMap< I, T, C >::AddItem | ( | const I & | index,
 |  | const T * | item
 | ) | [inline]

Adds an item to the list. This does not allocate an item as this is left to the user to do

Parameters:
item the item pointer to add

template<class I, class T, class C = std::less<I>>
void RNReplicaNet::RegistryManagerMap< I, T, C >::BeginIterate ( void ) [inline]

Starts the iteration of the items in the list from the start and works forwards

template<class I, class T, class C = std::less<I>>
void RNReplicaNet::RegistryManagerMap< I, T, C >::EndIterate ( void ) [inline]

Starts the iteration of the items in the list from the end and works backwards

template<class I, class T, class C = std::less<I>>
T* RNReplicaNet::RegistryManagerMap< I, T, C >::FindItem ( const I & index ) [inline]

Finds an item using the index and if found also sets the current iterator to the item in the map. The direction of the iterator is set to be kUndefined.

Parameters:
index The index to use.
Returns:
The pointer to T corresponding to the index or null if the index was not found.

template<class I, class T, class C = std::less<I>>
T* RNReplicaNet::RegistryManagerMap< I, T, C >::Iterate ( void ) [inline]

Iterates through the items in the list

Returns:
returns the next item pointer in the list or returns NULL for the end of the list

template<class I, class T, class C = std::less<I>>
void RNReplicaNet::RegistryManagerMap< I, T, C >::RemoveItem ( void ) [inline]

Removes the item at the current iterator.

template<class I, class T, class C = std::less<I>>
bool RNReplicaNet::RegistryManagerMap< I, T, C >::RemoveItem ( const I & index ) [inline]

Removes an item from the list but does not free the item as this is left to the user to do

Parameters:
item the item pointer to remove
Returns:
True indicates the index was in the map. False indicates the index was not in the map.

The documentation for this class was generated from the following file:
  • RegistryManagerMap.h


Platform: RNReplicaNet::SysTime Class Reference

RNReplicaNet::SysTime

RNReplicaNet::SysTime Class Reference

#include <SysTime.h>

List of all members.

Public Member Functions

SysTime ()
virtual | ~SysTime ()
float | FloatTime (void)

Detailed Description

Enables a high performance timer to be used

Constructor & Destructor Documentation

RNReplicaNet::SysTime::SysTime ( )

The ctor performs some basic initialisation

virtual RNReplicaNet::SysTime::~SysTime ( ) [virtual]

The dtor makes sure everything is tidy

Member Function Documentation

float RNReplicaNet::SysTime::FloatTime ( void )

Read the current time and return the time as a float

The documentation for this class was generated from the following file:
  • SysTime.h


Platform: RNReplicaNet::Thread Class Reference

RNReplicaNet::Thread

RNReplicaNet::Thread Class Reference

#include <Thread.h>

Collaboration diagram for RNReplicaNet::Thread:

[legend]
List of all members.

Public Member Functions

Thread ()
virtual | ~Thread ()
void | Begin (ThreadClass *threaded_class)
void | Terminate (void)
bool | GetIsRunning (void) const

Static Public Member Functions

static int | CallThreadEntry (ThreadClass *thread_class)

Detailed Description

This Thread class handles creating a class that can be automatically threaded. A threaded class inherits methods from ThreadClass.

Constructor & Destructor Documentation

RNReplicaNet::Thread::Thread ( )

The ctor performs some basic initialisation

virtual RNReplicaNet::Thread::~Thread ( ) [virtual]

The dtor makes sure everything is tidy

Member Function Documentation

void RNReplicaNet::Thread::Begin ( ThreadClass * threaded_class )

This begins the thread in the specified ThreadClass class. Execution begins from ThreadClass::ThreadEntry()

Parameters:
threaded_class the pointer to the class that inherits from ThreadClass

static int RNReplicaNet::Thread::CallThreadEntry ( ThreadClass * thread_class ) [static]

This is a static method where the class starts its thread from

Parameters:
thread_class the threaded class pointer

bool RNReplicaNet::Thread::GetIsRunning ( void ) const

Gets the execution status of the thread

Returns:
return true if the thread is running

void RNReplicaNet::Thread::Terminate ( void )

Terminates the thread of the class bound to this Thread. The caller must not be in the context of the running thread.

The documentation for this class was generated from the following file:
  • Thread.h
Generated on Sun Oct 30 01:12:32 2005 for Platform by doxygen 1.4.1


Platform: RNReplicaNet::ThreadClass Class Reference

RNReplicaNet::ThreadClass

RNReplicaNet::ThreadClass Class Reference

#include <ThreadClass.h>

Inheritance diagram for RNReplicaNet::ThreadClass:

[legend]
Collaboration diagram for RNReplicaNet::ThreadClass:

[legend]
List of all members.

Public Member Functions

ThreadClass ()
virtual | ~ThreadClass ()
void | Sleep (int milliseconds)

Protected Member Functions

void | DoQuitNow (const int returnCode)

Friends

class | Thread

Detailed Description

This is a class that the thread manager can thread with. Entry for a thread starts at ThreadEntry.

Constructor & Destructor Documentation

RNReplicaNet::ThreadClass::ThreadClass ( )

The ctor performs some basic initialisation

virtual RNReplicaNet::ThreadClass::~ThreadClass ( ) [virtual]

The dtor makes sure everything is tidy

Member Function Documentation

void RNReplicaNet::ThreadClass::DoQuitNow ( const int returnCode ) [protected]

This exits the thread and can only be used in the context of the thread.

Parameters:
returnCode The return code.

void RNReplicaNet::ThreadClass::Sleep ( int milliseconds )

Sleeps the thread for the class by the number of milliseconds supplied. This uses the CurrentThreadSleep() function. Internally this is a point where the thread can be cancelled. There must not be any mutex object with a current lock when Sleep() is called otherwise a deadlock situation may develop.

Parameters:
milliseconds the sleep time in milliseconds

The documentation for this class was generated from the following file:
  • ThreadClass.h
Generated on Sun Oct 30 01:12:33 2005 for Platform by doxygen 1.4.1


Platform: Hierarchical Index

Platform Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • RNReplicaNet::Checksum
  • RNReplicaNet::CurrentThread
  • RNReplicaNet::Database
  • RNReplicaNet::DatabaseLinkNode
  • RNReplicaNet::DatabaseLinkNodePool
  • RNReplicaNet::DatabaseManager< T >
  • RNReplicaNet::DatabaseNode
  • RNReplicaNet::Encryption
  • RNReplicaNet::Encryption::Key
  • RNReplicaNet::LockingMechanism
  • RNReplicaNet::MessageHelper
  • RNReplicaNet::MutexClass
    • RNReplicaNet::ThreadClass
  • RNReplicaNet::PlatformHeap
  • RNReplicaNet::PlatformHeapBlock
  • RNReplicaNet::PlatformInfo
  • RNReplicaNet::RegistryManager< T >
  • RNReplicaNet::RegistryManagerList< T >
  • RNReplicaNet::RegistryManagerMap< I, T, C >
  • RNReplicaNet::SysTime
  • RNReplicaNet::Thread


Platform: Class Members

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • AddData() : RNReplicaNet::MessageHelper
  • AddFloat() : RNReplicaNet::MessageHelper
  • AddInteger() : RNReplicaNet::MessageHelper
  • AddItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >
  • AddItemHead() : RNReplicaNet::RegistryManagerList< T >
  • AddVariable() : RNReplicaNet::MessageHelper

- b -

  • Begin() : RNReplicaNet::Thread
  • BeginIterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- c -

  • CallThreadEntry() : RNReplicaNet::Thread
  • ChecksumData() : RNReplicaNet::Checksum

- d -

  • DatabaseManager() : RNReplicaNet::DatabaseManager< T >
  • Decrypt() : RNReplicaNet::Encryption
  • DoQuitNow() : RNReplicaNet::ThreadClass
  • DumpAsHex() : RNReplicaNet::MessageHelper

- e -

  • Encrypt() : RNReplicaNet::Encryption
  • EndIterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::DatabaseManager< T >

- f -

  • FindItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::DatabaseManager< T >
  • FloatTime() : RNReplicaNet::SysTime
  • ForceFree() : RNReplicaNet::PlatformHeap

- g -

  • GetData() : RNReplicaNet::MessageHelper
  • GetFloat() : RNReplicaNet::MessageHelper
  • GetInteger() : RNReplicaNet::MessageHelper
  • GetIsRunning() : RNReplicaNet::Thread
  • GetSize() : RNReplicaNet::MessageHelper
  • GetVariable() : RNReplicaNet::MessageHelper

- i -

  • IsLittleEndian() : RNReplicaNet::PlatformInfo
  • IsThreaded() : RNReplicaNet::PlatformInfo
  • Iterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- l -

  • Lock() : RNReplicaNet::MutexClass
  • LockingMechanism() : RNReplicaNet::LockingMechanism

- m -

  • MessageHelper() : RNReplicaNet::MessageHelper
  • MutexClass() : RNReplicaNet::MutexClass

- p -

  • PlatformHeapBlock() : RNReplicaNet::PlatformHeapBlock

- r -

  • Register() : RNReplicaNet::PlatformHeapBlock
  • RegistryManager() : RNReplicaNet::RegistryManager< T >
  • RegistryManagerList() : RNReplicaNet::RegistryManagerList< T >
  • RegistryManagerMap() : RNReplicaNet::RegistryManagerMap< I, T, C >
  • RemoveItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- s -

  • SetBuffer() : RNReplicaNet::MessageHelper
  • SetEnableFastFind() : RNReplicaNet::DatabaseManager< T >
  • SetSize() : RNReplicaNet::MessageHelper
  • SetThreaded() : RNReplicaNet::PlatformInfo
  • Sleep() : RNReplicaNet::ThreadClass
  • SysTime() : RNReplicaNet::SysTime

- t -

  • Terminate() : RNReplicaNet::Thread
  • Thread() : RNReplicaNet::Thread
  • ThreadClass() : RNReplicaNet::ThreadClass

- u -

  • UnLock() : RNReplicaNet::MutexClass

- ~ -

  • ~DatabaseManager() : RNReplicaNet::DatabaseManager< T >
  • ~LockingMechanism() : RNReplicaNet::LockingMechanism
  • ~MessageHelper() : RNReplicaNet::MessageHelper
  • ~MutexClass() : RNReplicaNet::MutexClass
  • ~PlatformHeapBlock() : RNReplicaNet::PlatformHeapBlock
  • ~RegistryManager() : RNReplicaNet::RegistryManager< T >
  • ~RegistryManagerList() : RNReplicaNet::RegistryManagerList< T >
  • ~RegistryManagerMap() : RNReplicaNet::RegistryManagerMap< I, T, C >
  • ~SysTime() : RNReplicaNet::SysTime
  • ~Thread() : RNReplicaNet::Thread
  • ~ThreadClass() : RNReplicaNet::ThreadClass


Platform: Directory Hierarchy

Platform Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • ReplicaNetWork
    • RNPlatform
      • Inc
Generated on Sun Oct 30 01:12:34 2005 for Platform by doxygen 1.4.1


Platform: C:/Work/ReplicaNetWork/ Directory Reference

ReplicaNetWork

ReplicaNetWork Directory Reference

Directories

directory RNPlatform


Platform: C:/Work/ReplicaNetWork/RNPlatform/ Directory Reference

RNPlatform Directory Reference

Directories

directory | Inc

Files

file | PlatformDoc.cpp


Platform: C:/Work/ReplicaNetWork/RNPlatform/Inc/ Directory Reference

Inc Directory Reference

Files

file | CheckSum.h [code]
file | ClassReg.h [code]
file | CThreadClass.h [code]
file | Database.h [code]
file | DatabaseManager.h [code]
file | DLLExportAPI.h [code]
file | Encryption.h [code]
file | FreewareCode.h [code]
file | MemoryTracking.h [code]
file | MessageHelper.h [code]
file | PlatformHeap.h [code]
file | PlatformInfo.h [code]
file | RegistryManager.h [code]
file | RegistryManagerList.h [code]
file | RegistryManagerMap.h [code]
file | SysTime.h [code]
file | Thread.h [code]
file | ThreadClass.h [code]


Platform: Graphical Class Hierarchy

Go to the textual class hierarchy

Generated on Sun Oct 30 01:12:35 2005 for Platform by doxygen 1.4.1


Platform: CheckSum.h Source File

CheckSum.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef _CHECKSUM_H_
00012 #define _CHECKSUM_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00021 class REPNETEXPORTAPI Checksum
00022 {
00023 public:
00030     static int ChecksumData(const char *buffer,const int length);
00031
00032 private:
00033     Checksum(){}
00034     virtual ~Checksum(){}
00035 };
00036
00037 } // namespace RNReplicaNet
00038
00039 #endif


Platform: ClassReg.h Source File

ClassReg.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef _CLASSREG_H_
00012 #define _CLASSREG_H_
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00018 // This header is reserved for future use
00019
00020 } // namespace RNReplicaNet
00021
00022 #endif


Platform: Member List

RNReplicaNet::Checksum Member List

This is the complete list of members for RNReplicaNet::Checksum, including all inherited members.

ChecksumData(const char *buffer, const int length) RNReplicaNet::Checksum [static]


Platform: Member List

RNReplicaNet::DatabaseManager< T > Member List

This is the complete list of members for RNReplicaNet::DatabaseManager< T >, including all inherited members.

AddItem(T *item) | RNReplicaNet::DatabaseManager< T > | [inline]
AddItemHead(T *item) (defined in RNReplicaNet::DatabaseManager< T >) | RNReplicaNet::DatabaseManager< T > | [inline]
BeginIterate(void) | RNReplicaNet::DatabaseManager< T > | [inline]
DatabaseManager() | RNReplicaNet::DatabaseManager< T > | [inline]
EndIterate(void) | RNReplicaNet::DatabaseManager< T > | [inline]
FindItem(void *keyData) | RNReplicaNet::DatabaseManager< T > | [inline]
Iterate(void) | RNReplicaNet::DatabaseManager< T > | [inline]
RemoveItem(T *item) | RNReplicaNet::DatabaseManager< T > | [inline]
RemoveItem(void) | RNReplicaNet::DatabaseManager< T > | [inline]
SetCompareDataWithKeyFunc(t_CompareDataWithKeyFunc *pfunc) (defined in RNReplicaNet::DatabaseManager< T >) | RNReplicaNet::DatabaseManager< T > | [inline]
SetEnableFastFind(bool enable=false) | RNReplicaNet::DatabaseManager< T > | [inline]
SetHashFromDataFunc(t_HashFromDataFunc *pfunc) (defined in RNReplicaNet::DatabaseManager< T >) | RNReplicaNet::DatabaseManager< T > | [inline]
SetHashFromKeyFunc(t_HashFromKeyFunc *pfunc) (defined in RNReplicaNet::DatabaseManager< T >) | RNReplicaNet::DatabaseManager< T > | [inline]
Tidy(void) (defined in RNReplicaNet::DatabaseManager< T >) | RNReplicaNet::DatabaseManager< T > | [inline]
~DatabaseManager() | RNReplicaNet::DatabaseManager< T > | [inline, virtual]


Platform: Member List

RNReplicaNet::Encryption Member List

This is the complete list of members for RNReplicaNet::Encryption, including all inherited members.

Decrypt(void *data, int length, Key *key) | RNReplicaNet::Encryption | [static]
Encrypt(void *data, int length, Key *key) | RNReplicaNet::Encryption | [static]


Platform: Member List

RNReplicaNet::LockingMechanism Member List

This is the complete list of members for RNReplicaNet::LockingMechanism, including all inherited members.

LockingMechanism(MutexClass *lockee) | RNReplicaNet::LockingMechanism | [inline]
~LockingMechanism() | RNReplicaNet::LockingMechanism | [inline, virtual]

Generated on Sun Oct 30 01:12:34 2005 for Platform by doxygen 1.4.1


Platform: Member List

RNReplicaNet::MessageHelper Member List

This is the complete list of members for RNReplicaNet::MessageHelper, including all inherited members.

AddData(const void *data, const int size) | RNReplicaNet::MessageHelper |
AddFloat(const float value) | RNReplicaNet::MessageHelper |
AddInteger(const int value) | RNReplicaNet::MessageHelper |
AddVariable(const void *variable, const int size) | RNReplicaNet::MessageHelper |
DumpAsHex(const void *data, const int size) | RNReplicaNet::MessageHelper | [static]
GetData(void *const data, const int size) | RNReplicaNet::MessageHelper |
GetFloat(void) | RNReplicaNet::MessageHelper |
GetInteger(void) | RNReplicaNet::MessageHelper |
GetSize(void) | RNReplicaNet::MessageHelper |
GetVariable(void *const variable, const int size) | RNReplicaNet::MessageHelper |
MessageHelper() | RNReplicaNet::MessageHelper |
SetBuffer(void *const buffer) | RNReplicaNet::MessageHelper |
SetSize(const int size) | RNReplicaNet::MessageHelper |
~MessageHelper() | RNReplicaNet::MessageHelper | [virtual]


Platform: Member List

RNReplicaNet::MutexClass Member List

This is the complete list of members for RNReplicaNet::MutexClass, including all inherited members.

kNoOwnerThread enum value (defined in RNReplicaNet::MutexClass) | RNReplicaNet::MutexClass |
Lock(void) | RNReplicaNet::MutexClass |
MutexClass() | RNReplicaNet::MutexClass |
UnLock(void) | RNReplicaNet::MutexClass |
~MutexClass() | RNReplicaNet::MutexClass | [virtual]

Generated on Sun Oct 30 01:12:33 2005 for Platform by doxygen 1.4.1


Platform: Member List

RNReplicaNet::PlatformHeap Member List

This is the complete list of members for RNReplicaNet::PlatformHeap, including all inherited members.

ForceFree(void) RNReplicaNet::PlatformHeap [static]


Platform: Member List

RNReplicaNet::PlatformHeapBlock Member List

This is the complete list of members for RNReplicaNet::PlatformHeapBlock, including all inherited members.

PlatformHeapBlock() | RNReplicaNet::PlatformHeapBlock |
Register(void) | RNReplicaNet::PlatformHeapBlock |
~PlatformHeapBlock() | RNReplicaNet::PlatformHeapBlock | [virtual]


Platform: Member List

RNReplicaNet::PlatformInfo Member List

This is the complete list of members for RNReplicaNet::PlatformInfo, including all inherited members.

IsLittleEndian(void) | RNReplicaNet::PlatformInfo | [static]
IsThreaded(void) | RNReplicaNet::PlatformInfo | [static]
SetThreaded(const bool allow) | RNReplicaNet::PlatformInfo | [static]


Platform: Member List

RNReplicaNet::RegistryManager< T > Member List

This is the complete list of members for RNReplicaNet::RegistryManager< T >, including all inherited members.

AddItem(T *item) | RNReplicaNet::RegistryManager< T > | [inline]
BeginIterate(void) | RNReplicaNet::RegistryManager< T > | [inline]
Iterate(void) | RNReplicaNet::RegistryManager< T > | [inline]
RegistryManager() | RNReplicaNet::RegistryManager< T > | [inline]
RemoveItem(T *item) | RNReplicaNet::RegistryManager< T > | [inline]
RemoveItem(void) | RNReplicaNet::RegistryManager< T > | [inline]
~RegistryManager() | RNReplicaNet::RegistryManager< T > | [inline, virtual]


Platform: Member List

RNReplicaNet::RegistryManagerList< T > Member List

This is the complete list of members for RNReplicaNet::RegistryManagerList< T >, including all inherited members.

AddItem(T *item) | RNReplicaNet::RegistryManagerList< T > | [inline]
AddItemHead(T *item) | RNReplicaNet::RegistryManagerList< T > | [inline]
BeginIterate(void) | RNReplicaNet::RegistryManagerList< T > | [inline]
Direction enum name (defined in RNReplicaNet::RegistryManagerList< T >) | RNReplicaNet::RegistryManagerList< T > |
EndIterate(void) | RNReplicaNet::RegistryManagerList< T > | [inline]
Iterate(void) | RNReplicaNet::RegistryManagerList< T > | [inline]
kBackward enum value (defined in RNReplicaNet::RegistryManagerList< T >) | RNReplicaNet::RegistryManagerList< T > |
kForward enum value (defined in RNReplicaNet::RegistryManagerList< T >) | RNReplicaNet::RegistryManagerList< T > |
kUndefined enum value (defined in RNReplicaNet::RegistryManagerList< T >) | RNReplicaNet::RegistryManagerList< T > |
RegistryManagerList() | RNReplicaNet::RegistryManagerList< T > | [inline]
RemoveItem(T *item) | RNReplicaNet::RegistryManagerList< T > | [inline]
RemoveItem(void) | RNReplicaNet::RegistryManagerList< T > | [inline]
~RegistryManagerList() | RNReplicaNet::RegistryManagerList< T > | [inline, virtual]


Platform: Member List

RNReplicaNet::RegistryManagerMap< I, T, C > Member List

This is the complete list of members for RNReplicaNet::RegistryManagerMap< I, T, C >, including all inherited members.

AddItem(const I &index, const T *item) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
BeginIterate(void) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
Direction enum name (defined in RNReplicaNet::RegistryManagerMap< I, T, C >) | RNReplicaNet::RegistryManagerMap< I, T, C > |
EndIterate(void) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
FindItem(const I &index) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
Iterate(void) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
kBackward enum value (defined in RNReplicaNet::RegistryManagerMap< I, T, C >) | RNReplicaNet::RegistryManagerMap< I, T, C > |
kForward enum value (defined in RNReplicaNet::RegistryManagerMap< I, T, C >) | RNReplicaNet::RegistryManagerMap< I, T, C > |
kUndefined enum value (defined in RNReplicaNet::RegistryManagerMap< I, T, C >) | RNReplicaNet::RegistryManagerMap< I, T, C > |
RegistryManagerMap() | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
RemoveItem(const I &index) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
RemoveItem(void) | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline]
~RegistryManagerMap() | RNReplicaNet::RegistryManagerMap< I, T, C > | [inline, virtual]


Platform: Member List

RNReplicaNet::SysTime Member List

This is the complete list of members for RNReplicaNet::SysTime, including all inherited members.

FloatTime(void) | RNReplicaNet::SysTime |
SysTime() | RNReplicaNet::SysTime |
~SysTime() | RNReplicaNet::SysTime | [virtual]


Platform: Member List

RNReplicaNet::Thread Member List

This is the complete list of members for RNReplicaNet::Thread, including all inherited members.

Begin(ThreadClass *threaded_class) | RNReplicaNet::Thread |
CallThreadEntry(ThreadClass *thread_class) | RNReplicaNet::Thread | [static]
GetIsRunning(void) const | RNReplicaNet::Thread |
Terminate(void) | RNReplicaNet::Thread |
Thread() | RNReplicaNet::Thread |
~Thread() | RNReplicaNet::Thread | [virtual]

Generated on Sun Oct 30 01:12:32 2005 for Platform by doxygen 1.4.1


Platform: Member List

RNReplicaNet::ThreadClass Member List

This is the complete list of members for RNReplicaNet::ThreadClass, including all inherited members.

DoQuitNow(const int returnCode) | RNReplicaNet::ThreadClass | [protected]
kNoOwnerThread enum value (defined in RNReplicaNet::MutexClass) | RNReplicaNet::MutexClass |
Lock(void) | RNReplicaNet::MutexClass |
MutexClass() | RNReplicaNet::MutexClass |
Sleep(int milliseconds) | RNReplicaNet::ThreadClass |
Thread (defined in RNReplicaNet::ThreadClass) | RNReplicaNet::ThreadClass | [friend]
ThreadClass() | RNReplicaNet::ThreadClass |
UnLock(void) | RNReplicaNet::MutexClass |
~MutexClass() | RNReplicaNet::MutexClass | [virtual]
~ThreadClass() | RNReplicaNet::ThreadClass | [virtual]

Generated on Sun Oct 30 01:12:33 2005 for Platform by doxygen 1.4.1


Platform: CThreadClass.h Source File

CThreadClass.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __CTHREADCLASS_H__
00012 #define __CTHREADCLASS_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #ifdef __cplusplus
00016 extern "C"
00017 {
00018 #endif
00019
00024 REPNETEXPORTAPI extern void CurrentThreadSleep(int milliseconds);
00025
00026 typedef void tReplicaNet_SleepHookFunc(int);
00032 REPNETEXPORTAPI extern void CurrentThreadSleep_SetHook(tReplicaNet_SleepHookFunc *sleepFunction);
00033
00034 #ifdef __cplusplus
00035 }
00036 #endif
00037
00038 #endif


Platform: Database.h Source File

Database.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __DATABASE_H__
00012 #define __DATABASE_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00018 typedef int t_HashFromDataFunc(void *pData);
00019 typedef int t_HashFromKeyFunc(void *pKey);
00020 typedef bool t_CompareDataWithKeyFunc(void *pData,void *pKey);
00021
00022 // This should always be 32 to use the full 32 bits of a 32 bit integer as a bit array
00023 const int kSubNodes = 32;
00024
00025 class DatabaseNode;
00026 struct DatabaseLinkNode;
00027 class DatabaseLinkNodePool;
00028
00029 class REPNETEXPORTAPI Database
00030 {
00031 friend class DatabaseNode;
00032 public:
00033     enum Direction
00034     {
00035         kForward=0,
00036         kBackward,
00037         kUndefined
00038     };
00039
00040     Database();
00041     virtual ~Database();
00042
00043     void *AddItem(void *data);
00044     void *AddItemHead(void *data);
00045     void *FindItem(void *keyData);
00046     bool RemoveItem(void *data);
00047     bool RemoveItem(void);
00048
00049     void BeginIterate(void);
00050     void EndIterate(void);
00051     void *Iterate(void);
00052
00053     void SetHashFromDataFunc(t_HashFromDataFunc *pfunc);
00054     void SetHashFromKeyFunc(t_HashFromKeyFunc *pfunc);
00055     void SetCompareDataWithKeyFunc(t_CompareDataWithKeyFunc *pfunc);
00056
00057     void SetEnableFastFind(bool enable = false);
00058     bool GetEnableFastFind(void)
00059     {
00060         return mEnableFastFind;
00061     }
00062
00063     int Tidy(void);
00064
00065 private:
00066     bool mEnableFastFind;
00067     Direction mDirection;
00068     bool mUsed;
00069
00070     DatabaseNode *MatchNode(int objectHash,bool create);
00071     void SemiFreeDatabaseLinkNode (DatabaseLinkNode *theLinkNode);
00072
00073     t_HashFromDataFunc *mHashFromDataFunc;
00074     t_HashFromKeyFunc *mHashFromKeyFunc;
00075     t_CompareDataWithKeyFunc *mCompareDataWithKeyFunc;
00076
00077     // The start of the root node TREE, the mParent should always be null for example
00078     DatabaseNode *mTreeDatabaseNodeRoot;
00079     // The start of the link list of allocated root nodes, handy for stepping through when freeing for example
00080     // Depending on the order of allocation the mParent might not be null
00081     DatabaseNode *mLinkDatabaseNodeRoot;
00082
00083     // This pointer is used in the Tidy() routine that goes through the list looking for nodes to tidy
00084     // To avoid too much time being used up it only does a certain number of nodes per Tody() call
00085     DatabaseNode *mDatabaseNodeTidyIterator;
00086
00087     // The iterator values used in the iterator
00088     DatabaseLinkNode *mIterator;
00089
00090     // The backup previous values for the iterator
00091     DatabaseLinkNode *mPrevIterator;
00092
00093     // The last find puts the entries in here so a subsequent remove (data*) is quicker
00094     DatabaseNode *mFindCache;
00095     int mFindCacheCounter;
00096
00097     // The actual list head and tail used for the iterate LinkNode iterate
00098     // A totally empty list should have null for both
00099     DatabaseLinkNode *mLinkNodeRoot;
00100     DatabaseLinkNode *mLinkNodeTail;
00101
00102     // The head list pointers of cached pools to avoid too many small allocs that std::list uses
00103     // A totally empty list should have null pointers for both
00104     DatabaseLinkNodePool *mPoolRootNode;
00105     DatabaseLinkNodePool *mPoolFreeRootNode;
00106
00107     // The number of nodes not immediatly deleted and that contain no entries...
00108     int mNumNodesWithZeroEntries;
00109 };
00110
00111 class REPNETEXPORTAPI DatabaseNode
00112 {
00113 friend class Database;
00114 public:
00115     DatabaseNode(DatabaseNode *parent,Database *theDatabase);
00116     virtual ~DatabaseNode();
00117
00118 protected:
00119     void AddItem(void *data,DatabaseLinkNode *theLinkNode);
00120
00121     int mHash;
00122     DatabaseNode *mParent;
00123     DatabaseNode *mGreaterThan;
00124     DatabaseNode *mLessThan;
00125     DatabaseNode *mSame;
00126
00127     DatabaseNode *mLinkNext;
00128     DatabaseNode *mLinkPrev;
00129
00130     Database *mDatabase;
00131
00132     unsigned int mBitMask;
00133     void *mData[kSubNodes];
00134     DatabaseLinkNode *mTheLinkNode[kSubNodes];
00135 };
00136
00137 struct REPNETEXPORTAPI DatabaseLinkNode
00138 {
00139     DatabaseLinkNode *mNext;
00140     DatabaseLinkNode *mPrev;
00141     void *mData;
00142
00143     // The pools of link list entries
00144     DatabaseLinkNodePool *mOwnerPool;
00145     int mOwnerEntry;
00146
00147     // The values for the database lookup tree
00148     DatabaseNode *mDatabaseNode;
00149     int mDatabaseEntry;
00150 };
00151
00152 class REPNETEXPORTAPI DatabaseLinkNodePool
00153 {
00154 public:
00155     DatabaseLinkNodePool();
00156     virtual ~DatabaseLinkNodePool();
00157
00158     DatabaseLinkNodePool *mNext;
00159     DatabaseLinkNodePool *mPrev;
00160
00161     DatabaseLinkNodePool *mNextFree;
00162     DatabaseLinkNodePool *mPrevFree;
00163
00164     unsigned int mBitMask;
00165     DatabaseLinkNode mNodes[kSubNodes];
00166 };
00167
00168 } // namespace RNReplicaNet
00169
00170
00171 #endif


Platform: DatabaseManager.h Source File

DatabaseManager.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __DATABASEMANAGER_H__
00012 #define __DATABASEMANAGER_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include "RNPlatform/Inc/Database.h"
00015
00016 namespace RNReplicaNet
00017 {
00018
00022 template <class T> class DatabaseManager
00023 {
00024 public:
00028     DatabaseManager()
00029     {
00030     }
00031
00035     virtual ~DatabaseManager()
00036     {
00037     }
00038
00043     T *AddItem(T *item)
00044     {
00045         mDatabase.AddItem(item);
00046         return item;
00047     }
00048
00049     T *AddItemHead(T *item)
00050     {
00051         mDatabase.AddItemHead(item);
00052         return item;
00053     }
00054
00059     void RemoveItem(T *item)
00060     {
00061         mDatabase.RemoveItem(item);
00062     }
00063
00067     void RemoveItem(void)
00068     {
00069         mDatabase.RemoveItem();
00070     }
00071
00075     void BeginIterate(void)
00076     {
00077         mDatabase.BeginIterate();
00078     }
00079
00083     void EndIterate(void)
00084     {
00085         mDatabase.EndIterate();
00086     }
00087
00092     T *Iterate(void)
00093     {
00094         return (T *)mDatabase.Iterate();
00095     }
00096
00102     T *FindItem(void *keyData)
00103     {
00104         return (T *)mDatabase.FindItem(keyData);
00105     }
00106
00107     int Tidy(void)
00108     {
00109         return mDatabase.Tidy();
00110     }
00111
00116     void SetEnableFastFind(bool enable = false)
00117     {
00118         mDatabase.SetEnableFastFind(enable);
00119     }
00120
00121     void SetHashFromDataFunc(t_HashFromDataFunc *pfunc)
00122     {
00123         mDatabase.SetHashFromDataFunc(pfunc);
00124     }
00125
00126     void SetHashFromKeyFunc(t_HashFromKeyFunc *pfunc)
00127     {
00128         mDatabase.SetHashFromKeyFunc(pfunc);
00129     }
00130
00131     void SetCompareDataWithKeyFunc(t_CompareDataWithKeyFunc *pfunc)
00132     {
00133         mDatabase.SetCompareDataWithKeyFunc(pfunc);
00134     }
00135
00136
00137
00138 private:
00139     Database mDatabase;
00140 };
00141
00142 } // namespace RNReplicaNet
00143
00144
00145 #endif


Platform: DLLExportAPI.h Source File

DLLExportAPI.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __DLLEXPORTAPI_H__
00012 #define __DLLEXPORTAPI_H__
00013
00014 // These defines are here at the top-level so that they can be enabled by the user.
00015 // In an ideal world people will use the preprocessor define method, but in some cases the preprocessor defines cannot be changed.
00016 // Define this to enable ReplicaNet Visual Debugger information.
00017 //#define REPLICANET_VISUALDEBUGGER
00018 // Define this to disable all memory tracking, disable all overrides to new/delete/malloc/free/calloc/realloc
00019 //#define REPLICANET_NOMEMORYTRACKING
00020 // Define this to always include "RNPlatform/Inc/MemoryTracking.h"
00021 //#define REPLICANET_ALWAYSDOMEMORYTRACKING
00022
00023 // This pragma removes the harmless warning from MSVC about browse information and the STL
00024 #ifdef _MSC_VER
00025 #pragma warning(disable : 4786)
00026 #endif
00027
00028 #if defined(_WIN32)
00029
00030 // Remove some harmless warnings
00031 #pragma warning(disable: 4275)
00032 #pragma warning(disable: 4251)
00033
00034 // Rules for creating DLL export/import or static LIB version of this library
00035 #ifdef DOREPNETEXPORTAPI
00036
00037 #ifdef DOREPNETEXPORTAPIDEFS
00038 #define REPNETEXPORTAPI __declspec(dllexport)
00039 #else
00040 #define REPNETEXPORTAPI __declspec(dllimport)
00041 #endif
00042 #ifdef XPURLDLL_EXPORTS
00043 #define XPURLDLL_API __declspec(dllexport)
00044 #else
00045 #define XPURLDLL_API __declspec(dllimport)
00046 #endif
00047 #ifdef XPSESSIONDLL_EXPORTS
00048 #define XPSESSIONDLL_API __declspec(dllexport)
00049 #else
00050 #define XPSESSIONDLL_API __declspec(dllimport)
00051 #endif
00052 #ifdef REPLICANETDLL_EXPORTS
00053 #define REPLICANETDLL_API __declspec(dllexport)
00054 #else
00055 #define REPLICANETDLL_API __declspec(dllimport)
00056 #endif
00057
00058 // If we are in DLL mode then auto-include the memory tracking if we can
00059 #ifndef REPLICANET_NOAUTOMATICINCLUDEMEMORYTRACKING
00060 #include "RNPlatform/Inc/MemoryTracking.h"
00061 #endif
00062
00063 #else   // ifdef DOREPNETEXPORTAPIDEFS
00064
00065 #define REPNETEXPORTAPI
00066 #define XPURLDLL_API
00067 #define XPSESSIONDLL_API
00068 #define REPLICANETDLL_API
00069 #endif
00070
00071
00073 #else   // if defined(_WIN32)
00074
00075
00076 #define REPNETEXPORTAPI
00077 #define XPURLDLL_API
00078 #define XPSESSIONDLL_API
00079 #define REPLICANETDLL_API
00080
00081 #endif
00082
00083 #ifdef REPLICANET_ALWAYSDOMEMORYTRACKING
00084 #include "RNPlatform/Inc/MemoryTracking.h"
00085 #endif
00086
00087
00088 #endif


Platform: Encryption.h Source File

Encryption.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __ENCRYPTION_H__
00012 #define __ENCRYPTION_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00018 // Key length must be an integer multiple of 4 and be at least 8
00019 const int kEncryptionKeyLengthBytes = 8;
00020
00024 class REPNETEXPORTAPI Encryption
00025 {
00026 public:
00027     struct REPNETEXPORTAPI Key
00028     {
00029         public:
00030         Key();
00031         virtual ~Key();
00032
00038         void Create(void *data,int length);
00039
00040         unsigned char mKey[kEncryptionKeyLengthBytes];
00041     };
00042
00049     static void Encrypt(void *data,int length,Key *key);
00050
00057     static void Decrypt(void *data,int length,Key *key);
00058 };
00059
00060 } // namespace RNReplicaNet
00061
00062 #endif


Platform: FreewareCode.h Source File

FreewareCode.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __FREEWARECODE_H__
00012 #define __FREEWARECODE_H__
00013 #include "DLLExportAPI.h"
00014
00015 #ifdef __cplusplus
00016 extern "C"
00017 {
00018 #endif
00019
00024 REPNETEXPORTAPI bool FreewareSetRegistrationCode(const char *code);
00025
00026 #ifdef __cplusplus
00027 }
00028 #endif
00029
00030 #endif


Platform: Class Members - Functions

- a -

  • AddData() : RNReplicaNet::MessageHelper
  • AddFloat() : RNReplicaNet::MessageHelper
  • AddInteger() : RNReplicaNet::MessageHelper
  • AddItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >
  • AddItemHead() : RNReplicaNet::RegistryManagerList< T >
  • AddVariable() : RNReplicaNet::MessageHelper

- b -

  • Begin() : RNReplicaNet::Thread
  • BeginIterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- c -

  • CallThreadEntry() : RNReplicaNet::Thread
  • ChecksumData() : RNReplicaNet::Checksum

- d -

  • DatabaseManager() : RNReplicaNet::DatabaseManager< T >
  • Decrypt() : RNReplicaNet::Encryption
  • DoQuitNow() : RNReplicaNet::ThreadClass
  • DumpAsHex() : RNReplicaNet::MessageHelper

- e -

  • Encrypt() : RNReplicaNet::Encryption
  • EndIterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::DatabaseManager< T >

- f -

  • FindItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::DatabaseManager< T >
  • FloatTime() : RNReplicaNet::SysTime
  • ForceFree() : RNReplicaNet::PlatformHeap

- g -

  • GetData() : RNReplicaNet::MessageHelper
  • GetFloat() : RNReplicaNet::MessageHelper
  • GetInteger() : RNReplicaNet::MessageHelper
  • GetIsRunning() : RNReplicaNet::Thread
  • GetSize() : RNReplicaNet::MessageHelper
  • GetVariable() : RNReplicaNet::MessageHelper

- i -

  • IsLittleEndian() : RNReplicaNet::PlatformInfo
  • IsThreaded() : RNReplicaNet::PlatformInfo
  • Iterate() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- l -

  • Lock() : RNReplicaNet::MutexClass
  • LockingMechanism() : RNReplicaNet::LockingMechanism

- m -

  • MessageHelper() : RNReplicaNet::MessageHelper
  • MutexClass() : RNReplicaNet::MutexClass

- p -

  • PlatformHeapBlock() : RNReplicaNet::PlatformHeapBlock

- r -

  • Register() : RNReplicaNet::PlatformHeapBlock
  • RegistryManager() : RNReplicaNet::RegistryManager< T >
  • RegistryManagerList() : RNReplicaNet::RegistryManagerList< T >
  • RegistryManagerMap() : RNReplicaNet::RegistryManagerMap< I, T, C >
  • RemoveItem() : RNReplicaNet::RegistryManagerMap< I, T, C >, RNReplicaNet::RegistryManagerList< T >, RNReplicaNet::RegistryManager< T >, RNReplicaNet::DatabaseManager< T >

- s -

  • SetBuffer() : RNReplicaNet::MessageHelper
  • SetEnableFastFind() : RNReplicaNet::DatabaseManager< T >
  • SetSize() : RNReplicaNet::MessageHelper
  • SetThreaded() : RNReplicaNet::PlatformInfo
  • Sleep() : RNReplicaNet::ThreadClass
  • SysTime() : RNReplicaNet::SysTime

- t -

  • Terminate() : RNReplicaNet::Thread
  • Thread() : RNReplicaNet::Thread
  • ThreadClass() : RNReplicaNet::ThreadClass

- u -

  • UnLock() : RNReplicaNet::MutexClass

- ~ -

  • ~DatabaseManager() : RNReplicaNet::DatabaseManager< T >
  • ~LockingMechanism() : RNReplicaNet::LockingMechanism
  • ~MessageHelper() : RNReplicaNet::MessageHelper
  • ~MutexClass() : RNReplicaNet::MutexClass
  • ~PlatformHeapBlock() : RNReplicaNet::PlatformHeapBlock
  • ~RegistryManager() : RNReplicaNet::RegistryManager< T >
  • ~RegistryManagerList() : RNReplicaNet::RegistryManagerList< T >
  • ~RegistryManagerMap() : RNReplicaNet::RegistryManagerMap< I, T, C >
  • ~SysTime() : RNReplicaNet::SysTime
  • ~Thread() : RNReplicaNet::Thread
  • ~ThreadClass() : RNReplicaNet::ThreadClass


Platform: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Sun Oct 30 01:12:34 2005 for Platform by doxygen 1.4.1


Platform: MemoryTracking.h Source File

MemoryTracking.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __MEMORYTRACKING_H__
00012 #define __MEMORYTRACKING_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 // This file should be included first of all in all C/CPP files to ensure the memory hooks are used.
00016
00017 // These standard includes are pulled in automatically here to enable a clean build without warnings to be done using MSVC.
00018 // Otherwise the MS compiler starts complaining about dll linkage with the allocation routines.
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <malloc.h>
00022
00023 // Check for C++ being used
00024 #ifdef __cplusplus
00025 namespace RNReplicaNet
00026 {
00027 }
00028
00029 extern "C"
00030 {
00031 #endif
00032 #include <stddef.h>
00033 typedef size_t tReplicaNet_Size;
00034
00035 typedef void * tReplicaNet_AllocateFunc(tReplicaNet_Size);
00036 typedef void * tReplicaNet_ReAllocateFunc(void *, tReplicaNet_Size);
00037 typedef void * tReplicaNet_ClearAndAllocateFunc(tReplicaNet_Size, tReplicaNet_Size);
00038 typedef void tReplicaNet_FreeFunc(void *);
00039
00044 extern REPNETEXPORTAPI void SetReplicaNetAllocateFunction(tReplicaNet_AllocateFunc *allocateFunction);
00049 extern REPNETEXPORTAPI void SetReplicaNetReAllocateFunction(tReplicaNet_ReAllocateFunc *reAllocateFunction);
00054 extern REPNETEXPORTAPI void SetReplicaNetClearAndAllocateFunction(tReplicaNet_ClearAndAllocateFunc *clearAndAllocateFunction);
00059 extern REPNETEXPORTAPI void SetReplicaNetFreeFunction(tReplicaNet_FreeFunc *freeFunction);
00060
00066 extern REPNETEXPORTAPI void *ReplicaNet_AllocateFunction(tReplicaNet_Size size);
00067
00074 extern REPNETEXPORTAPI void *ReplicaNet_ReAllocateFunction(void *memblock, tReplicaNet_Size size);
00075
00082 extern REPNETEXPORTAPI void *ReplicaNet_ClearAndAllocateFunc(tReplicaNet_Size num, tReplicaNet_Size size);
00083
00088 extern REPNETEXPORTAPI void ReplicaNet_FreeFunc(void *memblock);
00089
00090 // Memory total generation
00091
00096 extern REPNETEXPORTAPI void ReplicaNet_MemoryTotalsEnable(void);
00097
00102 extern REPNETEXPORTAPI void ReplicaNet_MemoryTotalsDisable(void);
00103
00108 extern REPNETEXPORTAPI int ReplicaNet_MemoryTotalsState(void);
00109
00115 extern REPNETEXPORTAPI void ReplicaNet_MemoryTotalsQuery(int *blocks,int *allocated);
00116
00123 extern REPNETEXPORTAPI void ReplicaNet_MemoryTotalsPeakQuery(int *blocks,int *allocated,int reset);
00124
00125
00126 // Internal function.
00127 extern REPNETEXPORTAPI void ReplicaNet_MemoryDumpAllocatedBlocks(void);
00128 // Internal function.
00129 extern REPNETEXPORTAPI void ReplicaNet_MemoryBreakOnAllocatedBlocks(const int numBlocks,const int *theBlocks);
00130 // Make sure the std calls are redirected to our own functions
00131 #if defined(_WIN32) || defined(_PS2)
00132 #ifndef _MEMORYTRACKING_CPP_
00133 #ifndef REPLICANET_NOMEMORYTRACKING
00134 #define malloc ReplicaNet_AllocateFunction
00135 #define realloc ReplicaNet_ReAllocateFunction
00136 #define calloc ReplicaNet_ClearAndAllocateFunc
00137 #define free ReplicaNet_FreeFunc
00138 #endif
00139 #endif
00140 #endif
00141
00142 #ifdef __cplusplus
00143 };
00144 #endif
00145
00146 #ifdef __cplusplus
00147
00148
00149 #if defined(_WIN32)
00150 #ifndef REPLICANET_NOMEMORYTRACKING
00151 // Claim the new and delete operators for our own purposes
00152 inline void * __cdecl operator new(size_t size)
00153 {
00154     return ReplicaNet_AllocateFunction(size);
00155 };
00156
00157 inline void __cdecl operator delete(void *p)
00158 {
00159     ReplicaNet_FreeFunc(p);
00160 };
00161 #endif
00162 #endif
00163
00164
00165 #if defined(_PS2)
00166 #ifndef REPLICANET_NOMEMORYTRACKING
00167 // Claim the new and delete operators for our own purposes
00168 inline void * operator new(size_t size)
00169 {
00170     return ReplicaNet_AllocateFunction(size);
00171 };
00172
00173 inline void operator delete(void *p)
00174 {
00175     ReplicaNet_FreeFunc(p);
00176 };
00177 #endif
00178 #endif
00179
00180
00181 #endif
00182
00183 #endif


Platform: MessageHelper.h Source File

MessageHelper.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __MESSAGEHELPER_H__
00012 #define __MESSAGEHELPER_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014 #include <string>
00015
00016 namespace RNReplicaNet
00017 {
00018
00019 #define MESSAGEHELPER_ADDVARIABLE(x)    \
00020 AddVariable(&(x),sizeof(x));
00021
00022 #define MESSAGEHELPER_GETVARIABLE(x)    \
00023 GetVariable(&(x),sizeof(x));
00024
00025 #define MESSAGEHELPER_ADDVARIABLEp(y,x) \
00026 y.AddVariable(&(x),sizeof(x));
00027
00028 #define MESSAGEHELPER_GETVARIABLEp(y,x) \
00029 y.GetVariable(&(x),sizeof(x));
00030
00035 class REPNETEXPORTAPI MessageHelper
00036 {
00037 public:
00041     MessageHelper();
00042
00046     virtual ~MessageHelper();
00047
00052     void SetBuffer(void *const buffer);
00053
00059     void AddVariable(const void *variable,const int size);
00060
00066     void AddData(const void *data,const int size);
00067
00073     void GetVariable(void *const variable,const int size);
00074
00080     void GetData(void *const data,const int size);
00081
00086     int GetSize(void);
00087
00092     void SetSize(const int size);
00093
00098     void AddInteger(const int value);
00099
00104     void AddFloat(const float value);
00105
00110     int GetInteger(void);
00111
00117     float GetFloat(void);
00118
00122     static std::string DumpAsHex(const void *data,const int size);
00123
00124 private:
00125     unsigned char *mFirstPtr;
00126     unsigned char *mBufferPtr;
00127 };
00128
00129 } // namespace RNReplicaNet
00130
00131 #endif


Platform: PlatformHeap.h Source File

PlatformHeap.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __PLATFORMHEAP_H__
00012 #define __PLATFORMHEAP_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00021 class REPNETEXPORTAPI PlatformHeapBlock
00022 {
00023 public:
00027     PlatformHeapBlock();
00031     virtual ~PlatformHeapBlock();
00032
00036     void Register(void);
00037 };
00038
00043 class REPNETEXPORTAPI PlatformHeap
00044 {
00045 public:
00049     static void ForceFree(void);
00050 };
00051
00052 } // namespace RNReplicaNet
00053
00054 #endif


Platform: PlatformInfo.h Source File

PlatformInfo.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __PLATFORMINFO_H__
00012 #define __PLATFORMINFO_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 namespace RNReplicaNet
00016 {
00017
00021 class REPNETEXPORTAPI PlatformInfo
00022 {
00023 public:
00028     static bool IsThreaded(void);
00029
00034     static bool IsLittleEndian(void);
00035
00040     static void SetThreaded(const bool allow);
00041
00042 };
00043
00044 } // namespace RNReplicaNet
00045
00046 #endif


Platform: RegistryManager.h Source File

RegistryManager.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __REGISTRYMANAGER_H__
00012 #define __REGISTRYMANAGER_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #include <assert.h>
00016
00017 #include <vector>
00018
00019 namespace RNReplicaNet
00020 {
00021
00025 template <class T> class RegistryManager
00026 {
00027 public:
00031     RegistryManager()
00032     {
00033         mUsed = false;
00034     }
00035
00039     virtual ~RegistryManager()
00040     {
00041     }
00042
00047     void AddItem(T *item)
00048     {
00049         mItems.push_back(item);
00050     }
00051
00056     void RemoveItem(T *item)
00057     {
00058         std::vector<T *>::iterator tst,ten;
00059
00060         tst = mItems.begin();
00061         ten = mItems.end();
00062
00063         while(tst != ten)
00064         {
00065             T *titem = (T *) *tst;
00066             if (titem == item)
00067             {
00068                 if (mUsed)
00069                 {
00070                     if (tst < st)
00071                     {
00072                         st--;
00073                     }
00074                 }
00075                 mItems.erase(tst);
00076                 return;
00077             }
00078             tst++;
00079         }
00080     }
00081
00085     void RemoveItem(void)
00086     {
00087         assert(mUsed != false && "RegistryManager::RemoveItem() used when BeginIterate() not used or Iterate() reached the end of the list");
00088
00089         std::vector<T *>::iterator tst;
00090
00091         st--;
00092         tst = st;
00093         st++;
00094
00095         mItems.erase(tst);
00096     }
00097
00101     void BeginIterate(void)
00102     {
00103         mUsed = true;
00104         st = mItems.begin();
00105     }
00106
00111     T *Iterate(void)
00112     {
00113         assert(mUsed != false && "RegistryManager::Iterate() used when BeginIterate() not used or Iterate() reached the end of the list");
00114
00115         if (st < mItems.end())
00116         {
00117             T *tclass = *st++;
00118             return tclass;
00119         }
00120
00121         mUsed = false;
00122         return 0;
00123     }
00124
00125 private:
00126     std::vector<T *> mItems;
00128     typename std::vector<T *>::iterator st,en;
00129     bool mUsed;
00130 };
00131
00132 } // namespace RNReplicaNet
00133
00134 #endif


Platform: RegistryManagerList.h Source File

RegistryManagerList.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __REGISTRYMANAGERLIST_H__
00012 #define __REGISTRYMANAGERLIST_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #include <assert.h>
00016
00017 #include <list>
00018
00019 namespace RNReplicaNet
00020 {
00021
00025 template <class T> class RegistryManagerList
00026 {
00027 public:
00028     enum Direction
00029     {
00030         kForward=0,
00031         kBackward,
00032         kUndefined
00033     };
00034
00038     RegistryManagerList()
00039     {
00040         mDirection = kUndefined;
00041     }
00042
00046     virtual ~RegistryManagerList()
00047     {
00048     }
00049
00054     void AddItem(T *item)
00055     {
00056         mItems.push_back(item);
00057     }
00058
00063     void AddItemHead(T *item)
00064     {
00065         mItems.push_front(item);
00066     }
00067
00072     void RemoveItem(T *item)
00073     {
00074         std::list<T *>::iterator tst,ten;
00075
00076         tst = mItems.begin();
00077         ten = mItems.end();
00078
00079         while(tst != ten)
00080         {
00081             T *titem = (T *) *tst;
00082             if (titem == item)
00083             {
00084                 if (mDirection != kUndefined)
00085                 {
00086                     if (tst == st)
00087                     {
00088                         if (mDirection == kForward)
00089                         {
00090                             st++;
00091                             mItems.erase(tst);
00092                             return;
00093                         }
00094
00095                         if (mDirection == kBackward)
00096                         {
00097                             st--;
00098                             mItems.erase(tst);
00099                             st++;
00100                             return;
00101                         }
00102                     }
00103                 }
00104                 mItems.erase(tst);
00105                 return;
00106             }
00107             tst++;
00108         }
00109     }
00110
00114     void RemoveItem(void)
00115     {
00116         assert(mDirection != kUndefined && "RegistryManagerList::RemoveItem() used when BeginIterate() or EndIterate() not used or Iterate() reached the ned of the list");
00117
00118         std::list<T *>::iterator tst;
00119
00120         if (mDirection == kForward)
00121         {
00122             st--;
00123             tst = st;
00124             st++;
00125             mItems.erase(tst);
00126             return;
00127         }
00128
00129         if (mDirection == kBackward)
00130         {
00131             tst = st;
00132             st++;
00133             mItems.erase(tst);
00134         }
00135     }
00136
00140     void BeginIterate(void)
00141     {
00142         mDirection = kForward;
00143         st = mItems.begin();
00144     }
00145
00149     void EndIterate(void)
00150     {
00151         mDirection = kBackward;
00152         st = mItems.end();
00153     }
00154
00159     T *Iterate(void)
00160     {
00161         assert(mDirection != kUndefined && "RegistryManagerList::Iterate() used when BeginIterate() or EndIterate() not used or Iterate() reached the ned of the list");
00162
00163         if (mDirection == kForward)
00164         {
00165             if (st != mItems.end())
00166             {
00167                 T *tclass = *st;
00168                 st++;
00169                 return tclass;
00170             }
00171         }
00172
00173         if (mDirection == kBackward)
00174         {
00175             if (st != mItems.begin())
00176             {
00177                 st--;
00178                 T *tclass = *st;
00179                 return tclass;
00180             }
00181         }
00182
00183 #ifdef _DEBUG
00184         mDirection = kUndefined;
00185 #endif
00186         return 0;
00187     }
00188
00189 private:
00190
00191     std::list<T *> mItems;
00192     typename std::list<T *>::iterator st;
00193     Direction mDirection;
00194 };
00195
00196 } // namespace RNReplicaNet
00197
00198 #endif


Platform: RegistryManagerMap.h Source File

RegistryManagerMap.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __REGISTRYMANAGERMAP_H__
00012 #define __REGISTRYMANAGERMAP_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #include <assert.h>
00016
00017 #include <map>
00018
00019 namespace RNReplicaNet
00020 {
00021
00025 template <class I,class T,class C=std::less<I> > class RegistryManagerMap
00026 {
00027 public:
00028     enum Direction
00029     {
00030         kForward=0,
00031         kBackward,
00032         kUndefined
00033     };
00034
00038     RegistryManagerMap()
00039     {
00040         mDirection = kUndefined;
00041         st = mItems.end();
00042     }
00043
00047     virtual ~RegistryManagerMap()
00048     {
00049     }
00050
00055     bool AddItem(const I &index,const T *item)
00056     {
00057         std::pair<std::map<I,T*,C>::iterator,bool> aMapResult;
00058         aMapResult = mItems.insert(std::pair<I,T*>(index,(T*)item));
00059         return aMapResult.second;
00060     }
00061
00068     T* FindItem(const I &index)
00069     {
00070         std::map<I,T*,C>::iterator found;
00071
00072         found = mItems.find(index);
00073
00074         if (found != mItems.end())
00075         {
00076             st = found;
00077             mDirection = kUndefined;
00078             return (*found).second;
00079         }
00080         return 0;
00081     }
00082
00088     bool RemoveItem(const I &index)
00089     {
00090         std::map<I,T*,C>::iterator found;
00091
00092         found = mItems.find(index);
00093
00094         if (found != mItems.end())
00095         {
00096             if (mDirection != kUndefined)
00097             {
00098                 if (found == st)
00099                 {
00100                     if (mDirection == kForward)
00101                     {
00102                         st++;
00103                         mItems.erase(found);
00104                         return true;
00105                     }
00106
00107                     if (mDirection == kBackward)
00108                     {
00109                         st--;
00110                         mItems.erase(found);
00111                         st++;
00112                         return true;
00113                     }
00114                 }
00115             }
00116             mItems.erase(found);
00117             return true;
00118         }
00119         return false;
00120     }
00121
00125     void RemoveItem(void)
00126     {
00127         switch(mDirection)
00128         {
00129             default:
00130             {
00131                 assert(false && "Undefined direction state");
00132                 break;
00133             }
00134
00135             case kUndefined:
00136             {
00137                 // No direction so it was probably a find so remove the iterator where it is at.
00138                 mItems.erase(st);
00139                 st = mItems.end();
00140                 break;
00141             }
00142
00143             case kForward:
00144             {
00145                 std::map<I,T*,C>::iterator tst;
00146                 st--;
00147                 tst = st;
00148                 st++;
00149                 mItems.erase(tst);
00150                 break;
00151             }
00152
00153             case kBackward:
00154             {
00155                 std::map<I,T*,C>::iterator tst;
00156                 tst = st;
00157                 st++;
00158                 mItems.erase(tst);
00159                 break;
00160             }
00161         }
00162     }
00163
00167     void BeginIterate(void)
00168     {
00169         mDirection = kForward;
00170         st = mItems.begin();
00171     }
00172
00176     void EndIterate(void)
00177     {
00178         mDirection = kBackward;
00179         st = mItems.end();
00180     }
00181
00186     T *Iterate(void)
00187     {
00188         assert(mDirection != kUndefined && "RegistryManagerList::Iterate() used when BeginIterate() or EndIterate() not used or Iterate() reached the ned of the list");
00189
00190         if (mDirection == kForward)
00191         {
00192             if (st != mItems.end())
00193             {
00194                 T *tclass = (*st).second;
00195                 st++;
00196                 return tclass;
00197             }
00198         }
00199
00200         if (mDirection == kBackward)
00201         {
00202             if (st != mItems.begin())
00203             {
00204                 st--;
00205                 T *tclass = (*st).second;
00206                 return tclass;
00207             }
00208         }
00209
00210 #ifdef _DEBUG
00211         mDirection = kUndefined;
00212 #endif
00213         return 0;
00214     }
00215
00216 private:
00217
00218     std::map<I,T*,C> mItems;
00219     typename std::map<I,T*,C>::iterator st;
00220     Direction mDirection;
00221 };
00222
00223 } // namespace RNReplicaNet
00224
00225 #endif


Platform: SysTime.h Source File

SysTime.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __SYSTIME_H__
00012 #define __SYSTIME_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #if defined(_XBOX)
00016 #include <xtl.h>            // For XBox builds
00017 #else
00018 #if defined(_WIN32)
00019 #include <windows.h>        // For Windows builds
00020 #endif
00021 #endif
00022
00023 #if defined(_PS2)
00024 #include <eekernel.h>
00025 #endif
00026
00027 namespace RNReplicaNet
00028 {
00029
00033 class REPNETEXPORTAPI SysTime
00034 {
00035 public:
00036
00040     SysTime();
00041
00045     virtual ~SysTime();
00046
00050     float       FloatTime(void);
00051
00052 private:
00053 #if defined(_WIN32)
00054     double      pfreq;
00055     double      curtime;
00056     double      lastcurtime;
00057     int         lowshift;
00058     int         sametimecount;
00059     unsigned int    oldtime;
00060
00061
00062     LARGE_INTEGER startticktime;
00063     LARGE_INTEGER   PerformanceFreq;
00064 #endif
00065 #if defined(_PS2)
00066     u_long mPS2Initial;
00067 #endif
00068     int         first;
00069     unsigned int mBaseTickCount;
00070     int     mSecBase;
00071 };
00072
00073 } // namespace RNReplicaNet
00074
00075 #endif //#ifndef __SYSTIME_H__


Platform: Thread.h Source File

Thread.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __THREAD_H__
00012 #define __THREAD_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #if defined(linux) || defined(unix)
00016 #include <pthread.h>
00017 #endif
00018
00019 namespace RNReplicaNet
00020 {
00021
00022 class ThreadClass;
00023
00028 class REPNETEXPORTAPI Thread
00029 {
00030 public:
00034     Thread();
00035
00039     virtual ~Thread();
00040
00046     void Begin(ThreadClass *threaded_class);
00047
00051     void Terminate(void);
00052
00057     static int CallThreadEntry(ThreadClass *thread_class);
00058
00063     bool GetIsRunning(void) const;
00064
00065
00066 private:
00067     ThreadClass *mThreadClass;
00068 #if defined(_WIN32)
00069     void *mThreadHandle;
00070 //  unsigned long mThreadHandle;
00071 #endif
00072 #if defined(linux) || defined(unix)
00073     pthread_t mThreadHandle;
00074 #endif
00075 #if defined (_PS2)
00076     int mThreadHandle;
00077 #endif
00078
00079     volatile bool mIsRunning;
00080 };
00081
00082 } // namespace RNReplicaNet
00083
00084 #endif


Platform: ThreadClass.h Source File

ThreadClass.h

00001 /* START_LICENSE_HEADER
00002
00003 Copyright (C) 2000 Martin Piper, original design and program code
00004 Copyright (C) 2001-2005 Replica Software
00005
00006 This program file is copyright (C) Replica Software and can only be used under license.
00007 For more information visit: http://www.replicanet.com/
00008 Or email: info@replicanet.com
00009
00010 END_LICENSE_HEADER */
00011 #ifndef __THREADCLASS_H__
00012 #define __THREADCLASS_H__
00013 #include "RNPlatform/Inc/DLLExportAPI.h"
00014
00015 #if defined(_PS2)
00016 #include <list>
00017 #endif
00018
00019 namespace RNReplicaNet
00020 {
00021
00022 class Thread;
00023 const unsigned int kTIME_INFINITE = 0xFFFFFFFF;
00024
00028 class REPNETEXPORTAPI MutexClass
00029 {
00030 public:
00034     MutexClass();
00035
00039     virtual ~MutexClass();
00040
00044     void Lock(void);
00045
00049     void UnLock(void);
00050
00051     enum
00052     {
00053         kNoOwnerThread = -1
00054     };
00055
00056 private:
00057 #if defined(_PS2)
00058     // A binary semaphore created to lock all critical sections inside any mutex class
00059     // A mutex per class could be used however the PS2 does not allow many to be created
00060     static int mMutex;
00061     // The count of the lock, for recursive locks
00062     int mCount;
00063     // The owner thread of this mutex, kNoOwnerThread means no thread currently owns the mutex and the mCount should then be 0
00064     volatile int mOwnerThread;
00065     // A linked list of waiting threads for this mutex
00066     std::list<int> mWaitingThreadIDs;
00067 #else
00068     void *mMutex;
00069 #endif
00070 };
00071
00076 class REPNETEXPORTAPI ThreadClass : public MutexClass
00077 {
00078 public:
00082     ThreadClass();
00083
00087     virtual ~ThreadClass();
00088
00094     void Sleep(int milliseconds);
00095
00096 protected:
00101     void DoQuitNow(const int returnCode);
00102
00103 private:
00104
00105 friend class Thread;
00106     virtual int ThreadEntry(void) = 0;
00107
00108     volatile bool mQuitNow;
00109
00110     void CheckQuit(void);
00111     Thread *mBoundThread;
00112 };
00113
00117 class REPNETEXPORTAPI LockingMechanism
00118 {
00119 public:
00124     LockingMechanism(MutexClass *lockee) : mLockee(0)
00125     {
00126         if (lockee)
00127         {
00128             lockee->Lock();
00129         }
00130         mLockee = lockee;
00131     }
00132
00136     virtual ~LockingMechanism()
00137     {
00138         if (mLockee)
00139         {
00140             MutexClass *tl = mLockee;
00141             mLockee = 0;
00142             tl->UnLock();
00143         }
00144     }
00145
00146 private:
00147     MutexClass *mLockee;
00148 };
00149
00150 class REPNETEXPORTAPI CurrentThread
00151 {
00152 public:
00158     static void Sleep(int milliseconds);
00159 };
00160
00164 #define THREADSAFELOCK() RNReplicaNet::LockingMechanism _lock(this);
00165 #define THREADSAFELOCKCLASS(x) RNReplicaNet::LockingMechanism _class_lock(&(x));
00166 #define THREADSAFELOCKCLASSp(x) RNReplicaNet::LockingMechanism _class_lockp(x);
00167 #define THREADSAFELOCKCLASSNAMED(x) RNReplicaNet::LockingMechanism _class_lock##x (&(x));
00168 #define THREADSAFELOCKCLASSNAMEDp(x) RNReplicaNet::LockingMechanism _class_lockp##x (x);
00169
00170 } // namespace RNReplicaNet
00171
00172 #endif