Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

context::Context Class Reference

Represents a program context. More...

#include <context.h>

Collaboration diagram for context::Context:

Collaboration graph
[legend]
List of all members.

Public Methods

 Context (const string &argd)
 Constructs an object of this type and adds it to the ContextStack.

 ~Context ()
 Destructs this object and removes it from the ContextStack.

const std::string & getDescription () const
 Returns a description of this object.


Static Public Methods

void print (const vector< string > &list, size_t start=0, size_t end=0)
 Prints a vector of strings as a stack (FILO).


Detailed Description

Represents a program context.

Note:
The constructors and destructors have significant side effects


Constructor & Destructor Documentation

Context::Context const string &    argd
 

Constructs an object of this type and adds it to the ContextStack.

Parameters:
argd  A string description of this context

00036    :
00037 description(argd)
00038 {
00039    ContextStack::getInstanceOf().push(*this);
00040 }

Context::~Context  
 

Destructs this object and removes it from the ContextStack.

00047 {
00048    ContextStack::getInstanceOf().pop(*this);
00049 }


Member Function Documentation

const std::string & Context::getDescription   const
 

Returns a description of this object.

00056 {
00057    return description;
00058 }

void Context::print const vector< string > &    list,
size_t    start = 0,
size_t    end = 0
[static]
 

Prints a vector of strings as a stack (FILO).

Parameters:
list  The string stack
start  The start position
end  The end position

00069 {
00070    if (start>=list.size()) return;
00071    end=(end>start)?end:list.size();
00072 
00073    for (size_t i=end; i>start; --i)
00074    {
00075       std::cout<<list[i-1]<<"\n";
00076    }
00077 }


The documentation for this class was generated from the following files:
Generated on Mon Apr 7 19:44:10 2003 for DuTree by doxygen1.2.18