muParserX 2.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
mup::IToken Class Referenceabstract

Generic token interface for expression tokens. More...

#include <mpIToken.h>

Inheritance diagram for mup::IToken:
Inheritance graph
[legend]

Public Member Functions

ECmdCode GetCode () const
 return the token code.
 
const string_typeGetIdent () const
 Return the token identifier string.
 

Protected Member Functions

virtual ~IToken ()
 Destructor (trivial).
 
 IToken (const IToken &ref)
 Copy constructor.
 

Friends

std::ostream & operator<< (std::ostream &a_Stream, const IToken &a_Val)
 Overloaded streaming operator for outputting the value type into an std::ostream.
 

Detailed Description

Generic token interface for expression tokens.

Author
(C) 2010 Ingo Berg

Tokens can either be Functions, operators, values, variables or necessary base tokens like brackets. ´The IToken baseclass implements reference counting. Only TokenPtr<...> templates may be used as pointers to tokens.

Constructor & Destructor Documentation

◆ IToken()

mup::IToken::IToken ( const IToken & ref)
protected

Copy constructor.

Parameters
refThe token to copy basic state information from.

The copy constructor must be implemented in order not to screw up the reference count of the created object. CC's are used in the Clone function and they would start with a reference count != 0 introducing memory leaks if the default CC where used.

Member Function Documentation

◆ GetCode()

ECmdCode mup::IToken::GetCode ( ) const

return the token code.

See also
ECmdCode

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & a_Stream,
const IToken & a_Val )
friend

Overloaded streaming operator for outputting the value type into an std::ostream.

Parameters
a_StreamThe stream object
a_ValThe value object to be streamed

This function is only present if MUP_USE_WIDE_STRING is not defined.


muParserX documentation - (C) 2010 Ingo Berg