Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::Base Class Reference
[Base]

Acts as the base class for all OSCAR classes. More...

#include <Base.h>

Inheritance diagram for OSCAR::Base:

Inheritance graph
[legend]
List of all members.

Public Methods

 Base (const String &name=String(), OSCARError &err=DUMMY_ERROR(noError))
 Base (const Base &rhs)
virtual ~Base ()
virtual Base & operator= (const Base &rhs)
virtual const StringGetName () const
virtual void SetName (const String &name)
virtual const OSCARErrorGetError () const
virtual void ClearError () const

Static Public Methods

bool EnableErrorLogging (const String &errLogFileName=String("OSCARErrorLog.txt"))
bool DisableErrorLogging ()

Protected Methods

virtual void setError (const OSCARError &err) const

Protected Attributes

String name
OSCARError error

Static Protected Attributes

TLS std::ofstream errLogStream
TLS bool errLogging

Detailed Description

Author:
Chetan Kapoor
Acts as the base class for all other OSCAR classes. Base objects contain an OSCARError object that maintains the error state of each derived object.


Constructor & Destructor Documentation

OSCAR::Base::Base const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the Constructor for an object of type Base. Use this to construct an Base object with a name and an OSCARError object. If no values are provided for the parameters, then the default values are used.

Parameters:
name An String that specifies the name of the Base object being created. The default is an empty String.
err A reference to an object of type OSCARError. The default OSCARError object holds values that imply a "No Error" state.

OSCAR::Base::Base const Base &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type Base. Use this to construct an Base object from an existing Base object.

Parameters:
rhs An Base object that will be used to initialize this new object.

virtual OSCAR::Base::~Base   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type Base.


Member Function Documentation

virtual void OSCAR::Base::ClearError   const [virtual]
 

Clear the error state.

This method is used to clear the error state of an Base object to no error ("No Error").

See also:
GetError()

setError()

bool OSCAR::Base::DisableErrorLogging   [static]
 

Disable error logging for OSCAR applications.

This method is used to disable error logging for all OSCAR applications. Error Logging is shared across multiple threads and can be enabled or disabled by any.

Returns:
True if the error logging was disabled. Otherwise False, which implies that the error logging was not previously enabled by a call to EnableErrorLogging.
See also:
EnableErrorLogging(const String& errLogFileName)
Todo:
This method is not currently thread safe.

bool OSCAR::Base::EnableErrorLogging const String   errLogFileName = String("OSCARErrorLog.txt") [static]
 

Enable error logging for OSCAR applications.

This method is used to enable error logging for all OSCAR applications. This ensures that all errors flagged in any object of base type Base will be written to a file. This function can be called repeatedly with a different argument to write errors to different files. Error Logging is shared across multiple threads and can be enabled or disabled by any.

Parameters:
errLogFileName Name of the file to which errors will be written. If the file already exists, it will be overwritten.
Returns:
True if the error logging file was created. Otherwise False, which implies that the file was not created.
See also:
DisableErrorLogging()
Todo:
This method is not currently thread safe.

virtual const OSCARError& OSCAR::Base::GetError   const [virtual]
 

Get the error state.

This method is used to get the error state which is set by certain operations, for e.g. object creation, member function calls, etc. Each time there is a failure in creating an object or calling a function, this function can be used to get the failure reason (error value). There will be a file set up with the error values and corresponding descriptions.

Returns:
A constant OSCARError reference that holds the error value corresponding to some specific failure.
See also:
ClearError()

setError()

Reimplemented in OSCAR::PCRoboworksInterface.

virtual const String& OSCAR::Base::GetName   const [virtual]
 

Get the name.

This method is used to get a constant reference to the Name of the Base object.

Returns:
A constant String reference that holds the name of the object.
See also:
SetName()

virtual Base& OSCAR::Base::operator= const Base &    rhs [virtual]
 

Assignment Operator.

This is the Assignment Operator for an object of type Base.

Parameters:
rhs A Base object that goes on the right hand side of the = operator
Returns:
A reference to the object on the left hand side of the = operator

virtual void OSCAR::Base::setError const OSCARError   err const [protected, virtual]
 

Set the error state.

This method is used to set the error state of an Base object. The error value should be defined in a separate file. Refer to BaseError.h and BaseError.C. Some more specific errors can be defined in other files(e.g. HardwareError.h/C, FileError.h/C, etc.). This error state can be cleared by calling ClearError().

Parameters:
err An OSCARError object that corresponds to a certain error state to be set.
See also:
GetError()

ClearError()

virtual void OSCAR::Base::SetName const String   name [virtual]
 

Set the name.

This method is used to set the name of the Base object to the value of the parameter.

Parameters:
name An String that holds the name that you want to set.
See also:
GetName()


Member Data Documentation

TLS bool OSCAR::Base::errLogging [static, protected]
 

TLS std::ofstream OSCAR::Base::errLogStream [static, protected]
 

OSCARError OSCAR::Base::error [mutable, protected]
 

Reimplemented in OSCAR::ImpedanceFilter.

String OSCAR::Base::name [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations