2 #ifndef CARMA_UI_RTD_CONNECTIONS_H
3 #define CARMA_UI_RTD_CONNECTIONS_H
36 const int SIZEOF_USERNAME = 14;
37 const int SIZEOF_LONGUSERNAME = 60;
38 const int SIZEOF_FULLNAME = 40;
39 const int SIZEOF_COMPACTNAME = 40;
40 const int SIZEOF_LOCATION = 10;
41 const int SIZEOF_FULLLOCATION = 50;
42 const int SIZEOF_WINDOWNAME = 20;
43 const int SIZEOF_CONNECTSTART = 20;
44 const int SIZEOF_WINDOWUPDATE = 10;
45 const int NUMBEROF_CONNECTIONS = 150;
152 const char * userName,
153 const char * fullName,
154 const char * location,
155 const char * fullLocation,
173 void updateCnxControlState();
175 char controlChangeMessage[200];
207 #endif // CARMA_UI_RTD_CONNECTIONS_H
char longUserName[SIZEOF_LONGUSERNAME]
Control user, includes location, gecos.
char connectStartString[SIZEOF_CONNECTSTART]
UT time of start of connection.
bool haveControlUser
Logical: 1 if someone has control.
MemoryMappedFile * memMap
Pointer to the memory mapped file that contains connection database.
char * setControl(bool usurp)
Usurp or abdicates control; returns a message suitable for logging.
char userName[SIZEOF_USERNAME]
Control user short form, null string if nobody in control.
virtual ~ConnectionRW()
Destructor.
double connectStartMJD
MJD time of start of connection.
int processId
Server process (unique for each window)
Cnx * getThisCnx()
This method gets the current cnx from cache (refreshing if necessary)
int getSerialNumber()
Get the serial number of this data set (debugging)
int serialNumber
Increment everytime control or cnx change.
void lockWrite()
Lock connection database shared memory for read access.
ConnectionData * connection
Pointer to a copy of connect database.
char fullLocation[SIZEOF_FULLLOCATION]
Nodename w/ domain.
Protection_t
File protection flags.
Memory Mapped file is a class that provides a C++ interface to the mmap(2) system call...
char compactName[SIZEOF_COMPACTNAME]
Concatenation of username(fullname)
bool hasControl
The user for this window is in control (has usurped)
ConnectionRW(int pid, const std::string &filename)
Constructor.
Cnx cnx[NUMBEROF_CONNECTIONS]
Array of all of the individual connections.
char windowUpdateRate[SIZEOF_WINDOWUPDATE]
Window update rate in hertz.
bool valid
This entry has a valid connection in it.
virtual std::string toString()
Dump status of all connections to a string.
MemoryMappedFile is a class that provides a C++ interface to the mmap(2) system call.
std::string toString()
Return state of this object as a string.
void unregisterDeadWindows()
Remove dead processes from the connection table.
void registerWindow(const char *windowName, const char *userName, const char *fullName, const char *location, const char *fullLocation, int guest)
Register the window in the connection table.
char windowName[SIZEOF_WINDOWNAME]
Window name.
Class to access connection shared memory object with readonly mode.
void unlock()
Release lock on connection database shared memory.
bool guest
Flag for guest access mode.
virtual ~ConnectionBase()
Destructor.
char userName[SIZEOF_USERNAME]
Username, e.g. jsmith.
char fullName[SIZEOF_FULLNAME]
Full username, e.g. "Joe Smith".
int getMaxConnections()
Return the maximum number of connections possible.
Structure definition for a single connection to the system.
Structure definition for keeping track of all connections, windows, and user control of the system...
void lockRead()
Lock connection database shared memory for read access.
std::string memoryMappedFilename
Filename of connection database.
ConnectionBase(int pid, const std::string &filename, MemoryMappedFile::Protection_t p)
Constructor.
Base class for the connection objects.
int getCacheSerialNumber()
Get the serial number for the cached data (debugging)
virtual ~ConnectionRO()
Destructor.
int pid_
Process id for this connection.
void unregisterWindow(int pid)
Unregister the window in the connection table.
int getReloadInProgress()
Get the value of the reloadInProgress flag.
ConnectionData * getConnectionData()
This method gets the connectionData from cache (refreshing if necessary)
void setUpdateRate(double updateRate)
Set window update rate in seconds.
Class to access connection shared memory object with read/write mode.
void setPID(int _pid)
For backdoor debugging only.
void setReloadInProgress(int state)
Set or clear the reloadInProgress flag.
ConnectionRO(int pid, const std::string &filename)
Constructor.
char location[SIZEOF_LOCATION]
Nodename w/o domain.
bool reloadInProgress
Logical: 1 if a reload is in progress.