MCS  0.3.3-alpha7
mcs::ClientInfo Class Reference

Class holding information about a client connection. More...

#include <mcs.hh>

+ Inheritance diagram for mcs::ClientInfo:

Public Member Functions

 ClientInfo ()
 Constructor. More...
 
DatacommandExecuted ()
 Number of commands executed. More...
 
Datahostname ()
 Hostname of client. More...
 
Dataid ()
 Client ID, the same as the one returned with the MCS_CMD_CID command. More...
 
Dataipaddress ()
 IP address of client. More...
 
DatalastCommand ()
 Last command executed. More...
 
Datalogged ()
 True if the client has logged in. More...
 
DatatimeConnetcted ()
 Time at which the client connected. More...
 
DatatimeLastCommand ()
 Time at which the last command was executed. More...
 
Datausername ()
 User name. More...
 
- Public Member Functions inherited from mcs::Record
void addField (Data *d)
 Wrapper around Dynamic_Array.push. More...
 
void addField (Data &d)
 Wrapper around Dynamic_Array.push. More...
 
void addField (string s, char tag=0)
 Push a new Data object with base type STRING in the array. More...
 
void addField (int i, char tag=0)
 Push a new Data object with base type INT in the array. More...
 
void addField (long long int i, char tag=0)
 Push a new Data object with base type BIGINT in the array. More...
 
void addField (double f, char tag=0)
 Push a new Data object with base type DOUBLE in the array. More...
 
string asString (string sep="\)
 Return record content as a unique string. More...
 
string asStringNames (string sep="\)
 
string asStringTypes (string sep="\)
 
void clear ()
 
int count ()
 Wrapper around Dynamic_Array.count. More...
 
void emptyName ()
 Set all Data object's name to an empty string. More...
 
Data field (string name)
 Returns the Data object in the vector whose name is "name". More...
 
Data field (int pos)
 
unsigned int objSize ()
 Return how many bytes require the object to be serialized. More...
 
Recordoperator= (Record &from)
 Assignment operator, will copy all data objects. More...
 
Dataoperator[] (string name)
 
Dataoperator[] (int pos)
 
Data pop (int x=0)
 
int posWhoseNameIs (string name, enum ThrowExceptions throwexc=THROW)
 Return the index of the first Data objects whose name is "name". More...
 
 Record (Record &from)
 Copy constructor, will copy all data objects. More...
 
 Record (bool synchro=false)
 Constructor, build an empty record. The parameter is passed to the underlying Dynamic_Array object. More...
 
 Record (void *lbuf, bool synchro=false)
 Build a Record object from a buffer prepared with Record.prepareBuffer(). More...
 
void setFieldMap (string s="")
 Creates a new field map from the given string. More...
 
void setFieldMap (Record &rec)
 Copy the field map from one record to another. More...
 
void setNull ()
 Set all Data object's name to null values. More...
 
 ~Record ()
 Destructor. More...
 
- Public Member Functions inherited from mcs::Serializable
void * getEntireBuffer (unsigned int &size)
 
bool knowSize ()
 Reinitialize internal data. More...
 
unsigned int maxChunkSize ()
 Return the max size allowed for a chunk. More...
 
unsigned int nChunk ()
 If knowSize() is true, return how many chunks are required to send all data. More...
 
void * nextChunk (unsigned int &chunksize)
 Fills a buffer with next chunk to be sent. More...
 
Serializableoperator= (const Serializable &)
 Declared to avoid using of default assignment operator. More...
 
 Serializable (const Serializable &)
 Declared to avoid using of default copy constructor. More...
 
 Serializable (unsigned int lmaxChunksize=16384)
 Constructor, for custom data (type = SERIAL_UNKNOWN). More...
 
 Serializable (void *from, unsigned int size, bool freeAfterUse, unsigned int lmaxChunksize=16384)
 Constructor, for memory buffers (type = SERIAL_BUFFER). More...
 
 Serializable (string filename, unsigned int lmaxChunksize=16384)
 Constructor, for files (type = SERIAL_FILENAME). More...
 
 Serializable (int type, unsigned int lmaxChunksize=16384)
 
unsigned int size ()
 If knowSize() is true, return the size of the entire block of data. More...
 
virtual ~Serializable ()
 Destructor. More...
 
- Public Member Functions inherited from mcs::Synchro
int count ()
 Return how many times the current thread has locked the section. More...
 
bool enter (int op=1, unsigned int timeout=0)
 Enter, or try to enter a critical section. More...
 
int leave ()
 Leave a critical section. More...
 
Synchrooperator= (const Synchro &)
 Declared to avoid using of default assignment operator. More...
 
 Synchro (const Synchro &)
 Declared to avoid using of default copy constructor. More...
 
 Synchro ()
 Constructor. More...
 
void synchronize (bool setactive)
 Enable or disable the synchronization feature. More...
 
bool tryenter (unsigned int timeout=0)
 Wrapper around enter(), using op=MCS_SYNCHRO_TRY_LOCK if the parameter is 0, op=MCS_SYNCHRO_TRY_TIMED otherwise. More...
 
 ~Synchro ()
 Destructor. More...
 

Detailed Description

Class holding information about a client connection.

A reference to such an object can be obtained from the UserThread::info() method to obtain information about that client connection.

Definition at line 6273 of file mcs.hh.

Constructor & Destructor Documentation

◆ ClientInfo()

mcs::ClientInfo::ClientInfo ( )

Constructor.

Definition at line 303 of file Server.cc.

Member Function Documentation

◆ commandExecuted()

Data & mcs::ClientInfo::commandExecuted ( )

Number of commands executed.

Definition at line 324 of file Server.cc.

◆ hostname()

Data & mcs::ClientInfo::hostname ( )

Hostname of client.

Definition at line 319 of file Server.cc.

◆ id()

Data & mcs::ClientInfo::id ( )

Client ID, the same as the one returned with the MCS_CMD_CID command.

Definition at line 317 of file Server.cc.

◆ ipaddress()

Data & mcs::ClientInfo::ipaddress ( )

IP address of client.

Definition at line 318 of file Server.cc.

◆ lastCommand()

Data & mcs::ClientInfo::lastCommand ( )

Last command executed.

Definition at line 322 of file Server.cc.

◆ logged()

Data & mcs::ClientInfo::logged ( )

True if the client has logged in.

Definition at line 325 of file Server.cc.

◆ timeConnetcted()

Data & mcs::ClientInfo::timeConnetcted ( )

Time at which the client connected.

Definition at line 320 of file Server.cc.

◆ timeLastCommand()

Data & mcs::ClientInfo::timeLastCommand ( )

Time at which the last command was executed.

Definition at line 323 of file Server.cc.

◆ username()

Data & mcs::ClientInfo::username ( )

User name.

Definition at line 321 of file Server.cc.


The documentation for this class was generated from the following files:

mcslogo

MCS (My Customizable Server) ver. 0.3.3-alpha7
Documentation generated on Mon May 28 07:39:41 UTC 2018