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

CTagBaseCommand Class Reference

#include <CTagBaseCommand.h>

List of all members.

Public Methods

 CTagBaseCommand ()
 Default constructor.

 ~CTagBaseCommand ()
 Destructor.

unsigned int getTagBase () const
unsigned int getTagSize () const
virtual int operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, int argc, char **argv)
int SetBase (CTCLInterpreter &rinterp, CTCLResult &rResult, int argc, char **argv)
int List (CTCLInterpreter &rInterp, CTCLResult &rResult, int argc, char **argv)
int NumTags (CTCLInterpreter &rfinterp, CTCLResult &rResult, int argc, char **argv)
unsigned int getTag (unsigned int nOffset)

Static Protected Methods

void Usage (CTCLResult &rResult)
void EncodeInteger (CTCLResult &rResult, int value)

Private Methods

 CTagBaseCommand (const CTagBaseCommand &rhs)
 Copy constructor.

CTagBaseCommand & operator= (const CTagBaseCommand &rhs)
 Assignment.

int operator== (const CTagBaseCommand &rhs) const
 Comparison for equality.

int operator!= (const CTagBaseCommand &rhs) const

Private Attributes

unsigned int m_nTagBase
unsigned int m_nTagBits


Detailed Description

Encapsulates commands which manipulate the tag base. In the NSCL data acquisition system, all buffers have a 24 bit tag. The tag value is used to do selective recieves of routed data. In a buffer assembly environment, we may use different tag sets for the fragment generating systems as well as another different tag for the assembled buffers. This allows differentiated snooping otn the buffers. This command has the following forms:

Definition at line 302 of file CTagBaseCommand.h.


Constructor & Destructor Documentation

CTagBaseCommand::CTagBaseCommand  
 

Default constructor.

Default constructor. This is called when declarations of the form e.g.:

  • CTagBaseCommand object; are performed.
The command registered will be "tagbase"

Definition at line 297 of file CTagBaseCommand.cpp.

References DEFAULTTAGBASE, and DEFAULTTAGWIDTH.

CTagBaseCommand::~CTagBaseCommand   [inline]
 

Destructor.

Definition at line 311 of file CTagBaseCommand.h.

CTagBaseCommand::CTagBaseCommand const CTagBaseCommand &    rhs [private]
 

Copy constructor.


Member Function Documentation

void CTagBaseCommand::EncodeInteger CTCLResult &    rResult,
int    value
[static, protected]
 

Utility member to encode an integer into a result string.

Parameters:
rResult  - Object encapsulated result string (appended to).
nValue  - Integer Value to encode.

Definition at line 540 of file CTagBaseCommand.cpp.

Referenced by List(), and NumTags().

unsigned int CTagBaseCommand::getTag unsigned int    nOffset
 

Gets a tag from the set.

Parameters:
nOffset  - Tag offset from the base.
Exceptions:
CRangeError  if nOffset > m_nTagBits.

Definition at line 508 of file CTagBaseCommand.cpp.

References m_nTagBase, and m_nTagBits.

unsigned int CTagBaseCommand::getTagBase   const [inline]
 

Definition at line 323 of file CTagBaseCommand.h.

References m_nTagBase.

unsigned int CTagBaseCommand::getTagSize   const [inline]
 

Definition at line 326 of file CTagBaseCommand.h.

References m_nTagBits.

int CTagBaseCommand::List CTCLInterpreter &    rInterp,
CTCLResult &    rResult,
int    argc,
char **    argv
 

Lists the tag base currently in use. The result is the stringified value of m_nTagBase.

Parameters:
rInterp  - Interpreter under which the command is executing.
rResult  - Result string for the command.
argc,argv  - Parameters following the command (aggc == 0 is required).
Returns:
TCL_OK - If there are no parse error.
Returns:
TCL_ERROR - if there was a parse error.
Note:
Once parsing is complete it's impossible to have an error.

Definition at line 456 of file CTagBaseCommand.cpp.

References EncodeInteger(), m_nTagBase, and Usage().

Referenced by operator()().

int CTagBaseCommand::NumTags CTCLInterpreter &    rfinterp,
CTCLResult &    rResult,
int    argc,
char **    argv
 

Returns the number of items in a tag set. The result is the stringified valueof m_nTagBits.

Parameters:
rInterp  - Interpreter under which the command is running.
rResult  - Result string the command returns to the interpreter.
argc,argv  - Parameters following the -size switch; must be none.
Returns:
TCL_OK - If there are no parse error.
Returns:
TCL_ERROR - if there was a parse error.
Note:
Once parsing is complete it's impossible to have an error.

Definition at line 487 of file CTagBaseCommand.cpp.

References EncodeInteger(), m_nTagBits, and Usage().

Referenced by operator()().

int CTagBaseCommand::operator!= const CTagBaseCommand &    rhs const [private]
 

int CTagBaseCommand::operator() CTCLInterpreter &    rInterp,
CTCLResult &    rResult,
int    argc,
char **    argv
[virtual]
 

Does initial command decode on the tagbase command. Control is then dispatched to one of SetBase, List, or NumTags depending on the subcommand or lack of a subcommand.

Parameters:
rInterp  - The interpreter on which the command is executing.
rResult  - Object encapsulation of the result string to be return to the interpreter by the command. The contents of this string depend not only on the sub-function executed, but also on the success or failure of that subfunction.
argc,argv  - Command parameters. Note that argv[0] is the name of the command.
Returns:
TCL_OK if everything went well.
Returns:
TCL_ERROR on error.

Definition at line 330 of file CTagBaseCommand.cpp.

References List(), NumTags(), SetBase(), and Usage().

CTagBaseCommand& CTagBaseCommand::operator= const CTagBaseCommand &    rhs [private]
 

Assignment.

int CTagBaseCommand::operator== const CTagBaseCommand &    rhs const [private]
 

Comparison for equality.

int CTagBaseCommand::SetBase CTCLInterpreter &    rInterp,
CTCLResult &    rResult,
int    argc,
char **    argv
 

Sets the tag base for the buffers emitted by this daq Readout program. Command Syntax:

tagbase newbase [newsize]

Parameters:
rInterp  - Interpreter under which the command is being run.
rResult  - Result string to be sent back to the interpreter by cammand execution.
argc,argv  - Parameters following command keyword.
Returns:
TCL_OK - If everything succeeded.
Returns:
TCL_ERROR - If there was a problem.
Note:
If newsize is not supplied, we default back to the default tagwidth. Newsize is rounded up to the nearest power of 2. so that tags fit in a mask.
Note:
Spectrodaq requires and it is a reported command error if newbase + newsize > LASTVALIDTAG.

Definition at line 383 of file CTagBaseCommand.cpp.

References DEFAULTTAGWIDTH, LASTVALIDTAG, m_nTagBase, m_nTagBits, and Usage().

Referenced by operator()().

void CTagBaseCommand::Usage CTCLResult &    rResult [static, protected]
 

Append a usage text string to the result object. This is usually called in response to a failed parse.

Parameters:
rResult  - Object encapsulated Result string to be appended to.

Definition at line 524 of file CTagBaseCommand.cpp.

Referenced by List(), NumTags(), operator()(), and SetBase().


Member Data Documentation

unsigned int CTagBaseCommand::m_nTagBase [private]
 

Definition at line 305 of file CTagBaseCommand.h.

Referenced by getTag(), getTagBase(), List(), and SetBase().

unsigned int CTagBaseCommand::m_nTagBits [private]
 

Definition at line 306 of file CTagBaseCommand.h.

Referenced by getTag(), getTagSize(), NumTags(), and SetBase().


The documentation for this class was generated from the following files:
Generated on Fri Nov 8 13:37:25 2002 for Event Readout system. by doxygen1.2.16