#include <pdfoperators.h>
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 |
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.
| 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.
| 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 | |||
| ) |
References _operands, debug::DBG_DBG, and utilsPrintDbg.
| pdfobjects::SimpleGenericOperator::~SimpleGenericOperator | ( | ) | [virtual] |
Destructor.
References _operandobserver, _operands, and UNREGISTER_SHAREDPTR_OBSERVER.
| shared_ptr< PdfOperator > pdfobjects::SimpleGenericOperator::clone | ( | ) | [protected, virtual] |
Clone this object.
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.
| 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.
| 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.
Implements pdfobjects::PdfOperator.
References _operands.
| void pdfobjects::SimpleGenericOperator::getStringRepresentation | ( | std::string & | str | ) | const [virtual] |
Get the string representation of this operator.
| str | String that will hold the representation of this operator. |
Implements pdfobjects::PdfOperator.
| 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.
boost::shared_ptr<observer::IObserver<IProperty> > pdfobjects::SimpleGenericOperator::_operandobserver [private] |
Operand observers registered on its operands.
Referenced by ~SimpleGenericOperator().
Operands.
Referenced by clone(), getParameters(), getParametersCount(), getStringRepresentation(), SimpleGenericOperator(), and ~SimpleGenericOperator().
const std::string pdfobjects::SimpleGenericOperator::_opText [private] |
Text representing the operator.
Referenced by clone(), getOperatorName(), and getStringRepresentation().