dtn::DTNServer Class Reference

#include <DTNServer.h>

List of all members.

Public Types

typedef void(* ShutdownProc )(void *args)
 Typedef for a shutdown procedure.

Public Member Functions

 DTNServer (const char *logpath, DTNStorageConfig *storage_config)
 ~DTNServer ()
DTNStorageConfigstorage_config ()
void init ()
bool init_datastore ()
 Initialize the datastore.
void close_datastore ()
 Close and sync the data store.
void start ()
 Start DTN daemon.
bool parse_conf_file (std::string &conf_file, bool conf_file_set)
 Parse the conf file.
void shutdown ()
 Shut down the server.
void set_app_shutdown (ShutdownProc proc, void *data)
 Set an application-specific shutdown handler.

Private Member Functions

bool init_dir (const char *dirname)
bool tidy_dir (const char *dirname)
bool validate_dir (const char *dirname)
void init_commands ()
 Initialize and register all the server related dtn commands.
void init_components ()
 Initialize all components before modifying any configuration.

Private Attributes

bool init_
oasys::atomic_t in_shutdown_
DTNStorageConfigstorage_config_
oasys::DurableStore * store_


Detailed Description

Encapsulation class for the "guts" of the server library.

Definition at line 31 of file DTNServer.h.


Member Typedef Documentation

typedef void(* dtn::DTNServer::ShutdownProc)(void *args)

Typedef for a shutdown procedure.


Constructor & Destructor Documentation

dtn::DTNServer::DTNServer ( const char *  logpath,
DTNStorageConfig storage_config 
)

Definition at line 71 of file DTNServer.cc.

dtn::DTNServer::~DTNServer (  ) 

Definition at line 80 of file DTNServer.cc.


Member Function Documentation

void dtn::DTNServer::close_datastore (  ) 

Close and sync the data store.

Definition at line 248 of file DTNServer.cc.

References dtn::GlobalStore::close(), dtn::GlobalStore::instance(), and store_.

Referenced by dtn::DTND::main(), and shutdown().

void dtn::DTNServer::init (  ) 

Initialize storage, components

NOTE: This needs to be called with thread barrier and timer system off because of initialization ordering constraints.

Definition at line 86 of file DTNServer.cc.

References ASSERT, init_commands(), and init_components().

Referenced by init_components(), and dtn::DTND::main().

void dtn::DTNServer::init_commands (  )  [private]

Initialize and register all the server related dtn commands.

Definition at line 207 of file DTNServer.cc.

References storage_config_.

Referenced by init().

void dtn::DTNServer::init_components (  )  [private]

Initialize all components before modifying any configuration.

Definition at line 236 of file DTNServer.cc.

References init(), and dtn::ConvergenceLayer::init_clayers().

Referenced by init().

bool dtn::DTNServer::init_datastore (  ) 

bool dtn::DTNServer::init_dir ( const char *  dirname  )  [private]

Definition at line 290 of file DTNServer.cc.

References errno.

Referenced by init_datastore().

bool dtn::DTNServer::parse_conf_file ( std::string &  conf_file,
bool  conf_file_set 
)

Parse the conf file.

Definition at line 156 of file DTNServer.cc.

References INSTALL_SYSCONFDIR.

Referenced by dtn::DTND::main().

void dtn::DTNServer::set_app_shutdown ( ShutdownProc  proc,
void *  data 
)

Set an application-specific shutdown handler.

Definition at line 284 of file DTNServer.cc.

void dtn::DTNServer::shutdown (  ) 

Shut down the server.

Definition at line 262 of file DTNServer.cc.

References close_datastore(), and in_shutdown_.

Referenced by dtn::DTND::main().

void dtn::DTNServer::start (  ) 

Start DTN daemon.

Definition at line 95 of file DTNServer.cc.

Referenced by dtn::DTND::main().

DTNStorageConfig* dtn::DTNServer::storage_config (  )  [inline]

Definition at line 37 of file DTNServer.h.

References storage_config_.

bool dtn::DTNServer::tidy_dir ( const char *  dirname  )  [private]

Definition at line 314 of file DTNServer.cc.

References errno.

Referenced by init_datastore().

bool dtn::DTNServer::validate_dir ( const char *  dirname  )  [private]

Definition at line 348 of file DTNServer.cc.

References errno.

Referenced by init_datastore().


Member Data Documentation

oasys::atomic_t dtn::DTNServer::in_shutdown_ [private]

Definition at line 70 of file DTNServer.h.

Referenced by shutdown().

Definition at line 69 of file DTNServer.h.

Definition at line 72 of file DTNServer.h.

Referenced by init_commands(), init_datastore(), and storage_config().

oasys::DurableStore* dtn::DTNServer::store_ [private]

Definition at line 73 of file DTNServer.h.

Referenced by close_datastore(), and init_datastore().


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

Generated on Fri Jan 30 09:43:14 2009 for DTN Reference Implementation by  doxygen 1.5.8