pdfobjects::SimpleGenericOperator Class Reference

#include <pdfoperators.h>

Inheritance diagram for pdfobjects::SimpleGenericOperator:
pdfobjects::PdfOperator ListItem< PdfOperator > pdfobjects::TextSimpleOperator

List of all members.

Public Member Functions

 SimpleGenericOperator (const char *opTxt, const size_t numOper, Operands &opers)
 SimpleGenericOperator (const std::string &opTxt, Operands &opers)
virtual size_t getParametersCount () const
virtual void getParameters (Operands &container) const
virtual void getOperatorName (std::string &first) const
virtual void getStringRepresentation (std::string &str) const
void init_operands (boost::shared_ptr< observer::IObserver< IProperty > > observer, boost::weak_ptr< CPdf > pdf, IndiRef *rf)
virtual ~SimpleGenericOperator ()

Protected Member Functions

virtual boost::shared_ptr
< PdfOperator
clone ()

Private Attributes

Operands _operands
const std::string _opText
boost::shared_ptr
< observer::IObserver
< IProperty > > 
_operandobserver

Detailed Description

Almost all simple (non composite) operators will be constructed by specifying number of operands, operands and the text representation of the operator.

This is an implementation of Composite design pattern where leaves and composites share the same interface.

See also:
PdfOperator

Constructor & Destructor Documentation

pdfobjects::SimpleGenericOperator::SimpleGenericOperator ( const char *  opTxt,
const size_t  numOper,
Operands opers 
)

Constructor. Create it as a standalone object. Prev and Next are not valid.

Parameters:
opTxt Operator name text representation.
numOper (Maximum) Number of operands.
opers This is a stack of operands from which we take number specified by numOper or while any operand left.

References _operands.

pdfobjects::SimpleGenericOperator::SimpleGenericOperator ( const std::string &  opTxt,
Operands opers 
)
pdfobjects::SimpleGenericOperator::~SimpleGenericOperator (  )  [virtual]

Member Function Documentation

shared_ptr< PdfOperator > pdfobjects::SimpleGenericOperator::clone (  )  [protected, virtual]

Clone this object.

Returns:
New clone.

Implements pdfobjects::PdfOperator.

References _operands, _opText, and pdfobjects::createOperator().

virtual void pdfobjects::SimpleGenericOperator::getOperatorName ( std::string &  first  )  const [inline, virtual]

Get the string operator name.

Parameters:
first String that will hold operator name.

Implements pdfobjects::PdfOperator.

References _opText.

Referenced by pdfobjects::TextSimpleOperator::getRawText(), and pdfobjects::TextSimpleOperator::setRawText().

virtual void pdfobjects::SimpleGenericOperator::getParameters ( Operands container  )  const [inline, virtual]

Get the parameters used with this operator.

Parameters:
container Will be used to store parameters.

Implements pdfobjects::PdfOperator.

References _operands.

Referenced by pdfobjects::TextSimpleOperator::getRawText(), and pdfobjects::TextSimpleOperator::setRawText().

virtual size_t pdfobjects::SimpleGenericOperator::getParametersCount (  )  const [inline, virtual]

Return the number of parameters.

Returns:
Number of parameters.

Implements pdfobjects::PdfOperator.

References _operands.

void pdfobjects::SimpleGenericOperator::getStringRepresentation ( std::string &  str  )  const [virtual]

Get the string representation of this operator.

Parameters:
str String that will hold the representation of this operator.

Implements pdfobjects::PdfOperator.

References _operands, and _opText.

void pdfobjects::SimpleGenericOperator::init_operands ( boost::shared_ptr< observer::IObserver< IProperty > >  ,
boost::weak_ptr< CPdf ,
IndiRef  
) [virtual]

Init operands and store observer for later unregistering.

Implements pdfobjects::PdfOperator.


Member Data Documentation

Operand observers registered on its operands.

Referenced by ~SimpleGenericOperator().

const std::string pdfobjects::SimpleGenericOperator::_opText [private]

Text representing the operator.

Referenced by clone(), getOperatorName(), and getStringRepresentation().


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