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

ArServerFileFromClient Class Reference

#include <ArServerFileUtils.h>

List of all members.

Public Member Functions

void addPostMoveCallback (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback to be called after moving from temp dir to final loc.
void addPreMoveCallback (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback to be called before moving from temp dir to final loc.
 ArServerFileFromClient (ArServerBase *server, const char *topDir, const char *tempDir)
 Constructor.
const char * getMovingFileName (void)
 Internal call for getting the name of the file we're moving.
void putFile (ArServerClient *client, ArNetPacket *packet)
 Puts the file.
void putFileInterleaved (ArServerClient *client, ArNetPacket *packet)
 Puts the file with interleaved responses.
void remPostMoveCallback (ArFunctor *functor)
 Removes a callback to be called after moving from temp dir to final loc.
void remPreMoveCallback (ArFunctor *functor)
 Removes a callback to be called before moving from temp dir to final loc.
virtual ~ArServerFileFromClient ()
 Destructor.

Protected Member Functions

void internalPutFile (ArServerClient *client, ArNetPacket *packet, bool interleaved)

Protected Attributes

char myBaseDir [2048]
int myFileNumber
std::map< std::string, FileInfo * > myMap
std::string myMovingFileName
std::list< ArFunctor * > myPostMoveCallbacks
std::list< ArFunctor * > myPreMoveCallbacks
ArFunctor2C< ArServerFileFromClient,
ArServerClient *, ArNetPacket * > 
myPutFileCB
ArFunctor2C< ArServerFileFromClient,
ArServerClient *, ArNetPacket * > 
myPutFileInterleavedCB
ArServerBasemyServer
char myTempDir [2048]

Classes

class  FileInfo


Detailed Description

Note:
Linux only
This class is set up so that a client can put files on the robot, this class ONLY puts files. This class will take a file from a client, writing it into the tempDir given in the constructor, then after receiving the file it'll move it over to the actual location requested. You should use this class by using ArClientFileToClient and NOT by using this classes interface directly, this is because the API is and will remain fairly volatile... if you need more functionality let us know and we'll add it if its reasonable.

Definition at line 126 of file ArServerFileUtils.h.


Constructor & Destructor Documentation

ArServerFileFromClient::ArServerFileFromClient ArServerBase server,
const char *  topDir,
const char *  tempDir
 

Constructor.

Definition at line 685 of file ArServerFileUtils.cpp.

References ArServerBase::addData(), ArUtil::appendSlash(), ArUtil::fixSlashes(), myBaseDir, myFileNumber, myPutFileCB, myPutFileInterleavedCB, myServer, and myTempDir.

ArServerFileFromClient::~ArServerFileFromClient  )  [virtual]
 

Destructor.

Definition at line 721 of file ArServerFileUtils.cpp.


Member Function Documentation

void ArServerFileFromClient::addPostMoveCallback ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback to be called after moving from temp dir to final loc.

Definition at line 1039 of file ArServerFileUtils.cpp.

References ArLog::log(), and myPostMoveCallbacks.

void ArServerFileFromClient::addPreMoveCallback ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a callback to be called before moving from temp dir to final loc.

Definition at line 1021 of file ArServerFileUtils.cpp.

References ArLog::log(), and myPreMoveCallbacks.

const char* ArServerFileFromClient::getMovingFileName void   )  [inline]
 

Internal call for getting the name of the file we're moving.

Definition at line 151 of file ArServerFileUtils.h.

References myMovingFileName.

void ArServerFileFromClient::internalPutFile ArServerClient client,
ArNetPacket packet,
bool  interleaved
[protected]
 

Definition at line 739 of file ArServerFileUtils.cpp.

References ArUtil::appendSlash(), ArServerBase::broadcastPacketTcp(), client, file, ArLog::log(), myBaseDir, ArServerFileFromClient::FileInfo::myFile, myFileNumber, ArServerFileFromClient::FileInfo::myLastActivity, myMap, myMovingFileName, myPostMoveCallbacks, myPreMoveCallbacks, ArServerFileFromClient::FileInfo::myRealFileName, myServer, ArServerFileFromClient::FileInfo::myStartedTransfer, myTempDir, ArServerFileFromClient::FileInfo::myTempFileName, ArTime::secSince(), ArClientBase::sendPacketTcp(), ArTime::setToNow(), ArBasePacket::strToBuf(), and ArBasePacket::uByte2ToBuf().

Referenced by putFile(), and putFileInterleaved().

void ArServerFileFromClient::putFile ArServerClient client,
ArNetPacket packet
 

Puts the file.

Definition at line 727 of file ArServerFileUtils.cpp.

References client, and internalPutFile().

void ArServerFileFromClient::putFileInterleaved ArServerClient client,
ArNetPacket packet
 

Puts the file with interleaved responses.

Definition at line 733 of file ArServerFileUtils.cpp.

References client, and internalPutFile().

void ArServerFileFromClient::remPostMoveCallback ArFunctor functor  ) 
 

Removes a callback to be called after moving from temp dir to final loc.

Definition at line 1051 of file ArServerFileUtils.cpp.

References myPostMoveCallbacks.

void ArServerFileFromClient::remPreMoveCallback ArFunctor functor  ) 
 

Removes a callback to be called before moving from temp dir to final loc.

Definition at line 1033 of file ArServerFileUtils.cpp.

References myPreMoveCallbacks.


Member Data Documentation

char ArServerFileFromClient::myBaseDir[2048] [protected]
 

Definition at line 155 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient(), and internalPutFile().

int ArServerFileFromClient::myFileNumber [protected]
 

Definition at line 167 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient(), and internalPutFile().

std::map<std::string, FileInfo *> ArServerFileFromClient::myMap [protected]
 

Definition at line 180 of file ArServerFileUtils.h.

Referenced by internalPutFile().

std::string ArServerFileFromClient::myMovingFileName [protected]
 

Definition at line 165 of file ArServerFileUtils.h.

Referenced by getMovingFileName(), and internalPutFile().

std::list<ArFunctor *> ArServerFileFromClient::myPostMoveCallbacks [protected]
 

Definition at line 159 of file ArServerFileUtils.h.

Referenced by addPostMoveCallback(), internalPutFile(), and remPostMoveCallback().

std::list<ArFunctor *> ArServerFileFromClient::myPreMoveCallbacks [protected]
 

Definition at line 158 of file ArServerFileUtils.h.

Referenced by addPreMoveCallback(), internalPutFile(), and remPreMoveCallback().

ArFunctor2C<ArServerFileFromClient, ArServerClient *, ArNetPacket *> ArServerFileFromClient::myPutFileCB [protected]
 

Definition at line 161 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient().

ArFunctor2C<ArServerFileFromClient, ArServerClient *, ArNetPacket *> ArServerFileFromClient::myPutFileInterleavedCB [protected]
 

Definition at line 163 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient().

ArServerBase* ArServerFileFromClient::myServer [protected]
 

Definition at line 157 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient(), and internalPutFile().

char ArServerFileFromClient::myTempDir[2048] [protected]
 

Definition at line 156 of file ArServerFileUtils.h.

Referenced by ArServerFileFromClient(), and internalPutFile().


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