Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

ArServerInfoStrings Class Reference

This will set up strings to send to MobileEyes so that server developers can easily add more information. More...

#include <ArServerInfoStrings.h>

List of all members.

Public Member Functions

void addString (const char *name, ArTypes::UByte2 maxLen, ArFunctor2< char *, ArTypes::UByte2 > *functor)
 Adds a string to the list in the raw format.
 ArServerInfoStrings (ArServerBase *server)
 Constructor.
ArFunctor3< const char *,
ArTypes::UByte2, ArFunctor2<
char *, ArTypes::UByte2 > * > * 
getAddStringFunctor (void)
 Gets the functor for adding a string (for ArStringInfoGroup).
void netGetStrings (ArServerClient *client, ArNetPacket *packet)
 Gets the strings.
void netGetStringsInfo (ArServerClient *client, ArNetPacket *packet)
 Gets the information about the strings being sent.
 ~ArServerInfoStrings ()
 Destructor.

Protected Member Functions

void buildStringsInfoPacket (void)
void buildStringsPacket (void)

Protected Attributes

ArFunctor3C< ArServerInfoStrings,
const char *, ArTypes::UByte2,
ArFunctor2< char *, ArTypes::UByte2 > * > 
myAddStringFunctor
ArTime myLastStringPacketBuild
ArTypes::UByte2 myMaxMaxLength
ArFunctor2C< ArServerInfoStrings,
ArServerClient *, ArNetPacket * > 
myNetGetStringsCB
ArFunctor2C< ArServerInfoStrings,
ArServerClient *, ArNetPacket * > 
myNetGetStringsInfoCB
ArServerBasemyServer
ArNetPacket myStringInfoPacket
ArNetPacket myStringPacket
std::list< ArStringInfoHolder * > myStrings
ArMutex myStringsMutex


Detailed Description

This will set up strings to send to MobileEyes so that server developers can easily add more information.

There are different ways ways you can add a string (they all are the same way internally). The raw way is addString which takes a functor with a buffer and a buffer len, the functor then has to fill in the string when called. The other ways are set up for convenience and are wrappers in this class around the addString, the other ways are addStringInt, addStringDouble, addStringBool, these all take a functor that returns the type and a format string (in addition to the name and maxLen again).

Examples:

serverDemo.cpp, and simpleServerExample.cpp.

Definition at line 46 of file ArServerInfoStrings.h.


Constructor & Destructor Documentation

ArServerInfoStrings::ArServerInfoStrings ArServerBase server  ) 
 

Constructor.

Definition at line 30 of file ArServerInfoStrings.cpp.

References ArServerBase::addData(), myMaxMaxLength, myNetGetStringsCB, myNetGetStringsInfoCB, and myServer.

ArServerInfoStrings::~ArServerInfoStrings  ) 
 

Destructor.

Definition at line 55 of file ArServerInfoStrings.cpp.


Member Function Documentation

void ArServerInfoStrings::addString const char *  name,
ArTypes::UByte2  maxLen,
ArFunctor2< char *, ArTypes::UByte2 > *  functor
 

Adds a string to the list in the raw format.

Definition at line 122 of file ArServerInfoStrings.cpp.

References ArServerBase::broadcastPacketTcp(), buildStringsInfoPacket(), ArMutex::lock(), myMaxMaxLength, myServer, myStringInfoPacket, myStrings, myStringsMutex, and ArMutex::unlock().

void ArServerInfoStrings::buildStringsInfoPacket void   )  [protected]
 

Definition at line 60 of file ArServerInfoStrings.cpp.

References ArNetPacket::empty(), ArStringInfoHolder::getMaxLength(), ArStringInfoHolder::getName(), ArMutex::lock(), myStringInfoPacket, myStrings, myStringsMutex, ArBasePacket::strToBuf(), ArBasePacket::uByte2ToBuf(), and ArMutex::unlock().

Referenced by addString(), and netGetStringsInfo().

void ArServerInfoStrings::buildStringsPacket void   )  [protected]
 

Definition at line 79 of file ArServerInfoStrings.cpp.

References ArNetPacket::empty(), ArStringInfoHolder::getFunctor(), ArStringInfoHolder::getMaxLength(), ArFunctor2< P1, P2 >::invoke(), ArMutex::lock(), ArTime::mSecSince(), myLastStringPacketBuild, myMaxMaxLength, myStringPacket, myStrings, myStringsMutex, ArBasePacket::strToBuf(), and ArMutex::unlock().

Referenced by netGetStrings().

ArFunctor3<const char *, ArTypes::UByte2, ArFunctor2<char *, ArTypes::UByte2> *>* ArServerInfoStrings::getAddStringFunctor void   )  [inline]
 

Gets the functor for adding a string (for ArStringInfoGroup).

Definition at line 65 of file ArServerInfoStrings.h.

References myAddStringFunctor.

Referenced by main().

void ArServerInfoStrings::netGetStrings ArServerClient client,
ArNetPacket packet
 

Gets the strings.

Definition at line 114 of file ArServerInfoStrings.cpp.

References buildStringsPacket(), client, myStringPacket, and ArClientBase::sendPacketTcp().

void ArServerInfoStrings::netGetStringsInfo ArServerClient client,
ArNetPacket packet
 

Gets the information about the strings being sent.

Definition at line 107 of file ArServerInfoStrings.cpp.

References buildStringsInfoPacket(), client, myStringInfoPacket, and ArClientBase::sendPacketTcp().


Member Data Documentation

ArFunctor3C<ArServerInfoStrings, const char *, ArTypes::UByte2, ArFunctor2<char *, ArTypes::UByte2> *> ArServerInfoStrings::myAddStringFunctor [protected]
 

Definition at line 80 of file ArServerInfoStrings.h.

Referenced by getAddStringFunctor().

ArTime ArServerInfoStrings::myLastStringPacketBuild [protected]
 

Definition at line 74 of file ArServerInfoStrings.h.

Referenced by buildStringsPacket().

ArTypes::UByte2 ArServerInfoStrings::myMaxMaxLength [protected]
 

Definition at line 77 of file ArServerInfoStrings.h.

Referenced by addString(), ArServerInfoStrings(), and buildStringsPacket().

ArFunctor2C<ArServerInfoStrings, ArServerClient *, ArNetPacket *> ArServerInfoStrings::myNetGetStringsCB [protected]
 

Definition at line 85 of file ArServerInfoStrings.h.

Referenced by ArServerInfoStrings().

ArFunctor2C<ArServerInfoStrings, ArServerClient *, ArNetPacket *> ArServerInfoStrings::myNetGetStringsInfoCB [protected]
 

Definition at line 83 of file ArServerInfoStrings.h.

Referenced by ArServerInfoStrings().

ArServerBase* ArServerInfoStrings::myServer [protected]
 

Definition at line 68 of file ArServerInfoStrings.h.

Referenced by addString(), and ArServerInfoStrings().

ArNetPacket ArServerInfoStrings::myStringInfoPacket [protected]
 

Definition at line 71 of file ArServerInfoStrings.h.

Referenced by addString(), buildStringsInfoPacket(), and netGetStringsInfo().

ArNetPacket ArServerInfoStrings::myStringPacket [protected]
 

Definition at line 73 of file ArServerInfoStrings.h.

Referenced by buildStringsPacket(), and netGetStrings().

std::list<ArStringInfoHolder *> ArServerInfoStrings::myStrings [protected]
 

Definition at line 76 of file ArServerInfoStrings.h.

Referenced by addString(), buildStringsInfoPacket(), and buildStringsPacket().

ArMutex ArServerInfoStrings::myStringsMutex [protected]
 

Definition at line 78 of file ArServerInfoStrings.h.

Referenced by addString(), buildStringsInfoPacket(), and buildStringsPacket().


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:52 2007 for ArNetworking by  doxygen 1.4.0