mcs::Env Class Reference

#include <mcs.hh>

List of all members.


Detailed Description

Hold all environment variables.

This class reads a configuration file named "mcs.conf" that must be in the working directory of execution, which contains all environment variables for the execution of a MCS-based application. You can see an example of a configuration file in the MCS distribution tree "share/test/mcs.conf". The file will be read using the Conf class. If one of the environment variable, or the entire file, aren't found then a default value will be assumed.

An Env object (or a derived one) must be istantiated in the main program, then used as parameter for the Server constructor.

See also:
Server

Definition at line 6886 of file mcs.hh.


Public Member Functions

 Env (const Env &)
 Declared to avoid using of default copy constructor.
 Env (string app="mcs", string inipath="mcs.conf")
 Env constructor.
Envoperator= (const Env &)
 Declared to avoid using of default assignment operator.
 ~Env ()
 Destructor.

Public Attributes

string appname
 Application name.
string appvers
 Application version.
bool cl_autoexec
 Auto execute batch file "auto".
int cl_chunksize
 Default size of a chunk of a Serializable object, that is chunks that goes through the network.
bool cl_clean_logout
 Clean work dir on user logout.
bool cl_createlocal
 Create local thread.
bool cl_custom_auth
 Activate custom authentication.
bool cl_have_db
 Activate DB facilities.
bool cl_local_kills_mcs
 When the local thread dies the server will be stopped.
bool cl_logfile
 Use log file.
bool cl_logstdout
 Copy log on stdout.
bool cl_read_grants
 Read grants from the DB table (deprecated).
bool cl_restartlocal
 Resart local thread when it dies.
bool cl_use_ssl
 Use secure connections.
bool cl_work
 Use private (per user) working dir, otherwise use path.
bool cl_work_cid
 Work path is created using cid if true, otherwise with the user name.
Confcnf
 Pointer to the Conf object used to read the configuration file.
string db_host
 Host running database server.
string db_name
 Database name.
string db_pass
 Password.
string db_user
 User name for the local thread access to DB.
ofstream * flog
 Stream to write the log file.
string inipath
 Application ini file.
string interface
 Server interface name.
LocalThreadlocal
string localhost
 Host name.
int max_users
 How many clients can be connected at the same time.
string path
 Main server path (APPD).
int port
 Server port number.
Serverserver
 Reference to actual server.
void * ssl_ctx
 Pointer to the global SSL context object, used if cl_use_ssl is true.
string sslcert
 Path to the SSL certificate file, used if cl_use_ssl = 1.
string sslpriv
 Path to the SSL private key file, used if cl_use_ssl = 1.
unsigned int timeout
 Timeout for client operations, in millisecond.

Private Member Functions

void chkTree ()
 Check the entire MCS tree.
void DumpConf ()
 Dump environment to configuration file.
void LoadConf ()
 Load configuration entries.

Private Attributes

DBConn db

Constructor & Destructor Documentation

mcs::Env::Env ( string  app = "mcs",
string  inipath = "mcs.conf" 
)

Env constructor.

Parameters:
app Application name, configuration entries will be searched under a "MCS_Generic" section for first, then under a section whose name is equal to tis parameter;
inipath Path for configuration file, default is "./mcs.conf".

Definition at line 130 of file Env.cc.

mcs::Env::Env ( const Env  ) 

Declared to avoid using of default copy constructor.

Warning:
This constructor is declared but not implemented. If you try to use it you will get a compilation error.

mcs::Env::~Env (  ) 

Destructor.

Definition at line 195 of file Env.cc.


Member Function Documentation

void mcs::Env::chkTree (  )  [private]

Check the entire MCS tree.

Definition at line 29 of file Env.cc.

void mcs::Env::DumpConf (  )  [private]

Dump environment to configuration file.

Definition at line 96 of file Env.cc.

void mcs::Env::LoadConf (  )  [private]

Load configuration entries.

Definition at line 43 of file Env.cc.

Env& mcs::Env::operator= ( const Env  ) 

Declared to avoid using of default assignment operator.

Warning:
This operator is declared but not implemented. If you try to use it you will get a compilation error.


Member Data Documentation

string mcs::Env::appname

Application name.

Definition at line 6943 of file mcs.hh.

string mcs::Env::appvers

Application version.

Definition at line 6946 of file mcs.hh.

bool mcs::Env::cl_autoexec

Auto execute batch file "auto".

Definition at line 7006 of file mcs.hh.

int mcs::Env::cl_chunksize

Default size of a chunk of a Serializable object, that is chunks that goes through the network.

Definition at line 7036 of file mcs.hh.

bool mcs::Env::cl_clean_logout

Clean work dir on user logout.

Definition at line 7000 of file mcs.hh.

bool mcs::Env::cl_createlocal

Create local thread.

Definition at line 6994 of file mcs.hh.

bool mcs::Env::cl_custom_auth

Activate custom authentication.

Definition at line 6979 of file mcs.hh.

bool mcs::Env::cl_have_db

Activate DB facilities.

Definition at line 6976 of file mcs.hh.

bool mcs::Env::cl_local_kills_mcs

When the local thread dies the server will be stopped.

Definition at line 6973 of file mcs.hh.

bool mcs::Env::cl_logfile

Use log file.

Definition at line 6982 of file mcs.hh.

bool mcs::Env::cl_logstdout

Copy log on stdout.

Definition at line 6991 of file mcs.hh.

bool mcs::Env::cl_read_grants

Read grants from the DB table (deprecated).

Definition at line 7003 of file mcs.hh.

bool mcs::Env::cl_restartlocal

Resart local thread when it dies.

Definition at line 6997 of file mcs.hh.

bool mcs::Env::cl_use_ssl

Use secure connections.

Definition at line 7009 of file mcs.hh.

bool mcs::Env::cl_work

Use private (per user) working dir, otherwise use path.

Definition at line 6985 of file mcs.hh.

bool mcs::Env::cl_work_cid

Work path is created using cid if true, otherwise with the user name.

Definition at line 6988 of file mcs.hh.

Conf* mcs::Env::cnf

Pointer to the Conf object used to read the configuration file.

Definition at line 6940 of file mcs.hh.

string mcs::Env::db_host

Host running database server.

Definition at line 7030 of file mcs.hh.

string mcs::Env::db_name

Database name.

Definition at line 7027 of file mcs.hh.

string mcs::Env::db_pass

Password.

Definition at line 7024 of file mcs.hh.

string mcs::Env::db_user

User name for the local thread access to DB.

Definition at line 7021 of file mcs.hh.

ofstream* mcs::Env::flog

Stream to write the log file.

Definition at line 7018 of file mcs.hh.

string mcs::Env::inipath

Application ini file.

Definition at line 6952 of file mcs.hh.

string mcs::Env::interface

Server interface name.

Definition at line 6958 of file mcs.hh.

string mcs::Env::localhost

Host name.

Definition at line 6955 of file mcs.hh.

int mcs::Env::max_users

How many clients can be connected at the same time.

Definition at line 6970 of file mcs.hh.

string mcs::Env::path

Main server path (APPD).

Definition at line 6949 of file mcs.hh.

int mcs::Env::port

Server port number.

Definition at line 6961 of file mcs.hh.

Server* mcs::Env::server

Reference to actual server.

Definition at line 6967 of file mcs.hh.

void* mcs::Env::ssl_ctx

Pointer to the global SSL context object, used if cl_use_ssl is true.

Definition at line 7039 of file mcs.hh.

string mcs::Env::sslcert

Path to the SSL certificate file, used if cl_use_ssl = 1.

Definition at line 7012 of file mcs.hh.

string mcs::Env::sslpriv

Path to the SSL private key file, used if cl_use_ssl = 1.

Definition at line 7015 of file mcs.hh.

unsigned int mcs::Env::timeout

Timeout for client operations, in millisecond.

Definition at line 7033 of file mcs.hh.


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

MCS (My Customizable Server) ver. 0.3.3-alpha3
Documentation generated on Thu Mar 22 13:22:23 UTC 2012