ESA JPIP server  0.1
AppInfo Class Reference

Contains the run-time information of the application. More...

#include <app_info.h>

Collaboration diagram for AppInfo:

Classes

struct  Data
 Contains the data block that is maintained in shared memory. More...
 

Public Member Functions

 AppInfo ()
 Initializes the object. More...
 
bool Init ()
 Initializes the object and the handling of the application run-time information. More...
 
bool is_running () const
 Returns true if the application is running. More...
 
AppInfoUpdate ()
 Updates the run-time information of the application. More...
 
double available_memory () const
 Returns the available memory of the system. More...
 
double father_memory () const
 Returns the memory used by the father process. More...
 
double child_memory () const
 Returns the memory used by the child process. More...
 
int num_threads () const
 Returns the number of active threads. More...
 
unsigned long child_time () const
 Returns the time spent by the child process. More...
 
unsigned long time () const
 Returns the time spent by the father process. More...
 
Dataoperator-> () const
 
 ~AppInfo ()
 

Private Member Functions

string GetProcStat_ (int pid, int field) const
 Returns a specific field of /proc/<pid>/stat as a string. More...
 
template<typename TYPE >
TYPE GetProcStat (int pid, int field) const
 Returns a specific field of /proc/<pid>/stat as a defined type. More...
 

Private Attributes

int shmid
 Identifier of the shared memory block. More...
 
int lock_file
 Lock file. More...
 
Datadata_ptr
 Pointer to the shared memory block. More...
 
bool is_running_
 true if the application is running More...
 
int num_threads_
 Number of active threads. More...
 
double child_memory_
 Memory used by the child process. More...
 
unsigned long time_
 Time spent by the father. More...
 
double father_memory_
 Memory used by the father process. More...
 
double available_memory_
 Available memory in the system. More...
 
unsigned long child_time_
 Time spend by the child. More...
 

Friends

ostream & operator<< (ostream &out, const AppInfo &app)
 

Detailed Description

Contains the run-time information of the application.

This class can be printed.

Constructor & Destructor Documentation

AppInfo::AppInfo ( )
inline

Initializes the object.

AppInfo::~AppInfo ( )

Member Function Documentation

double AppInfo::available_memory ( ) const
inline

Returns the available memory of the system.

Here is the caller graph for this function:

double AppInfo::child_memory ( ) const
inline

Returns the memory used by the child process.

Here is the caller graph for this function:

unsigned long AppInfo::child_time ( ) const
inline

Returns the time spent by the child process.

Here is the caller graph for this function:

double AppInfo::father_memory ( ) const
inline

Returns the memory used by the father process.

Here is the caller graph for this function:

template<typename TYPE >
TYPE AppInfo::GetProcStat ( int  pid,
int  field 
) const
inlineprivate

Returns a specific field of /proc/<pid>/stat as a defined type.

string AppInfo::GetProcStat_ ( int  pid,
int  field 
) const
private

Returns a specific field of /proc/<pid>/stat as a string.

bool AppInfo::Init ( )

Initializes the object and the handling of the application run-time information.

Returns
true if successful.

Here is the caller graph for this function:

bool AppInfo::is_running ( ) const
inline

Returns true if the application is running.

Here is the caller graph for this function:

int AppInfo::num_threads ( ) const
inline

Returns the number of active threads.

Here is the caller graph for this function:

Data* AppInfo::operator-> ( ) const
inline
unsigned long AppInfo::time ( ) const
inline

Returns the time spent by the father process.

AppInfo & AppInfo::Update ( )

Updates the run-time information of the application.

Here is the caller graph for this function:

Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const AppInfo app 
)
friend

Member Data Documentation

double AppInfo::available_memory_
private

Available memory in the system.

double AppInfo::child_memory_
private

Memory used by the child process.

unsigned long AppInfo::child_time_
private

Time spend by the child.

Data* AppInfo::data_ptr
private

Pointer to the shared memory block.

double AppInfo::father_memory_
private

Memory used by the father process.

bool AppInfo::is_running_
private

true if the application is running

int AppInfo::lock_file
private

Lock file.

int AppInfo::num_threads_
private

Number of active threads.

int AppInfo::shmid
private

Identifier of the shared memory block.

unsigned long AppInfo::time_
private

Time spent by the father.


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