FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
Public Member Functions | List of all members
CTCLResult Class Reference

#include <TCLResult.h>

Inheritance diagram for CTCLResult:
Inheritance graph
[legend]
Collaboration diagram for CTCLResult:
Collaboration graph
[legend]

Public Member Functions

 CTCLResult (CTCLInterpreter *pInterp, bool reset=true)
 
virtual ~CTCLResult ()
 
 CTCLResult (const CTCLResult &aCTCLResult)
 
CTCLResultoperator= (const CTCLResult &aCTCLResult)
 
CTCLResultoperator= (const char *rhs)
 
CTCLResultoperator= (std::string rhs)
 
int operator== (const CTCLResult &aCTCLResult)
 
int operator!= (const CTCLResult &rhs)
 
CTCLResultoperator+= (const char *pString)
 
CTCLResultoperator+= (const std::string &rString)
 
void Clear ()
 
void AppendElement (const char *pString)
 
void AppendElement (const std::string &rString)
 
void commit () const
 
std::string getString ()
 
- Public Member Functions inherited from CTCLObject
 CTCLObject (Tcl_Obj *am_pObject)
 
 CTCLObject (const CTCLObject &aCTCLObject)
 
CTCLObjectoperator= (const CTCLObject &aCTCLObject)
 
int operator== (const CTCLObject &aCTCLObject) const
 
Tcl_Obj * getObject ()
 
const Tcl_Obj * getObject () const
 
CTCLObjectoperator= (const std::string &rSource)
 
CTCLObjectoperator= (const char *pSource)
 
CTCLObjectoperator= (int nSource)
 
CTCLObjectoperator= (const CTCLList &rList)
 
CTCLObjectoperator= (double dSource)
 
CTCLObjectoperator= (Tcl_Obj *rhs)
 
CTCLObjectoperator= (Tcl_WideInt rhs)
 
 operator std::string ()
 
 operator int ()
 
 operator CTCLList ()
 
 operator double ()
 
CTCLObjectoperator+= (const CTCLObject &rObject)
 
CTCLObjectoperator+= (int nItem)
 
CTCLObjectoperator+= (const std::string &rItem)
 
CTCLObjectoperator+= (const char *pItem)
 
CTCLObjectoperator+= (double Item)
 
CTCLObjectoperator+= (Tcl_Obj *pObj)
 
CTCLObject clone ()
 
CTCLObject operator() ()
 
CTCLObject getRange (int first, int last)
 
CTCLObjectconcat (CTCLObject &rhs)
 
std::vector< CTCLObjectgetListElements ()
 
CTCLObjectsetList (std::vector< CTCLObject > elements)
 
int llength ()
 
CTCLObject lindex (int index)
 
CTCLObjectlreplace (int first, int count, std::vector< CTCLObject > newElements)
 
- Public Member Functions inherited from CTCLInterpreterObject
 CTCLInterpreterObject (CTCLInterpreter *pInterp)
 
 CTCLInterpreterObject (const CTCLInterpreterObject &aCTCLInterpreterObject)
 
CTCLInterpreterObjectoperator= (const CTCLInterpreterObject &aCTCLInterpreterObject)
 
int operator== (const CTCLInterpreterObject &aCTCLInterpreterObject) const
 
CTCLInterpretergetInterpreter () const
 
CTCLInterpreterBind (CTCLInterpreter &rBinding)
 
CTCLInterpreterBind (CTCLInterpreter *pBinding)
 

Additional Inherited Members

- Protected Member Functions inherited from CTCLObject
void setObject (Tcl_Obj *am_pObject)
 
void DupIfMust ()
 
void NewIfMust ()
 
- Protected Member Functions inherited from CTCLInterpreterObject
CTCLInterpreterAssertIfNotBound ()
 

Detailed Description

Encapsulates an interpreter result. We derive this from a CTCLObject in order to have the full expressive power of that class when building up the result string. The idea is that at construction the interpreter result will be reset or optionally our object loaded with its current value. Command processors will produce their result string here and then either at destruction time or explicitly, we will commit our contents to the result.

Constructor & Destructor Documentation

◆ CTCLResult() [1/2]

CTCLResult::CTCLResult ( CTCLInterpreter pInterp,
bool  reset = true 
)

Constructs a CTCLResult... Results are always bound to an interpreter...therefore our constructor requires an interpreter.

Parameters
pInterp: CTCLInterpreter* The interpreter to which we will be bound.
reset: bool (true) If true, the interpreter's result is reset, otherwise our contents are loaded from the interpreter's current result value.

◆ ~CTCLResult()

CTCLResult::~CTCLResult ( )
virtual

Destruction of a result implies commiting the contents of that result to the interpreter:

◆ CTCLResult() [2/2]

CTCLResult::CTCLResult ( const CTCLResult rhs)

Copy construction: we just need to bind ourselves to the same interpreter as the rhs... commit the rhs and load ourselves with the result string.

Member Function Documentation

◆ AppendElement()

void CTCLResult::AppendElement ( const char *  pString)

Append a string as an element. This is the base class +=

◆ Clear()

void CTCLResult::Clear ( )

Clear the result string and the interprter result too.

◆ commit()

void CTCLResult::commit ( ) const

Commit this to the result string:

◆ getString()

string CTCLResult::getString ( )

Commit and returnn the string.

◆ operator!=()

int CTCLResult::operator!= ( const CTCLResult rhs)

inequality is just the logical negation of equality:

◆ operator+=()

CTCLResult & CTCLResult::operator+= ( const char *  pString)

+= unfortunately has already been documented to have different semantics than that of the base class.. and we really can't do anything about that without breaking a bunch-o-code. Therefore we just live with it. here += implies string append. For element append, see AppendElement.

Parameters
pString: const char* the string to add.
Returns
CTCLResult&
Return values
*this

◆ operator=() [1/2]

CTCLResult & CTCLResult::operator= ( const CTCLResult rhs)

Assign to *this from another result:

  • commit the rhs.
  • assign to this from the interpreter string (base class assignment).

◆ operator=() [2/2]

CTCLResult & CTCLResult::operator= ( const char *  rhs)

Assign to self from const char* this is just base class function.

◆ operator==()

int CTCLResult::operator== ( const CTCLResult rhs)

equality - comparisons are always true if the interpreters are the sam as there should only be a single underlying result string.


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