NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
CMacroRep Class Reference

Search Toolkit Book for CMacroRep

Class for parsed macro representation. More...

#include <gui/objutils/macro_rep.hpp>

+ Inheritance diagram for CMacroRep:
+ Collaboration diagram for CMacroRep:

Public Types

typedef list< IMacroVar * > TVariables
 Typedef vector of variables. More...
 
typedef list< TVariablesTVarBlocks
 Typedef vector of blocks of variables. More...
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CMacroRep (CQueryExec *exec=NULL)
 Constructor. More...
 
 ~CMacroRep ()
 Destructor. More...
 
void Print (CNcbiOstream &os) const
 Output class content to NcbiCout. More...
 
void SetName (const string &name)
 Set the name of the macro. More...
 
void SetTitle (const string &title)
 Set the title of the macro. More...
 
void AddMetaKeywords (const string &keyWords)
 
const stringGetMetaKeywords () const
 
void SetNewVarBlock ()
 Set the new variable block. More...
 
void SetVarInt (const string &name, Int8 value)
 
void SetVarFloat (const string &name, double value)
 
void SetVarBool (const string &name, bool value)
 
void SetVarString (const string &name, const string &value)
 
void SetVarAsk (const string &name, const string &value)
 
void SetVarChoiceName (const string &name)
 
void SetVarChoiceInt (Int8 value)
 
void SetVarChoiceFloat (double value)
 
void SetVarChoiceBool (bool value)
 
void SetVarChoiceString (const string &value)
 
void SetForEachItem (const string &name)
 Set "for each" asn selector. More...
 
void SetNamedAnnot (const string &name)
 Set named annotation. More...
 
void SetSeqRange (const TSeqRange &range)
 Set the sequence range. More...
 
void SetThreadCount (const string &threads)
 Set number of threads. More...
 
void AttachWhereTree (CQueryParseTree *pWhereTree)
 Attach where tree after its constrution in qParser. More...
 
void SetFunction (const string &name, const CQueryParseNode::SSrcLoc &pos, CQueryParseTree::TNode *parentNode=0)
 Set function name. More...
 
void SetFunctionParameterAsIdent (const string &name, const CQueryParseNode::SSrcLoc &pos)
 Set the function parameters. More...
 
void SetFunctionParameterAsInt (Int8 value, const CQueryParseNode::SSrcLoc &pos)
 
void SetFunctionParameterAsFloat (double value, const CQueryParseNode::SSrcLoc &pos)
 
void SetFunctionParameterAsBool (bool value, const CQueryParseNode::SSrcLoc &pos)
 
void SetFunctionParameterAsString (const string &value, const CQueryParseNode::SSrcLoc &pos)
 
void SetAssignmentWhereClause (const string &where_str, CQueryParseTree *where_tree, const CQueryParseNode::SSrcLoc &pos)
 Set the function Where clause as a part of an assignment operator. More...
 
void SetSource (const string &source_text)
 Work with macro source text. More...
 
const stringGetSource () const
 
bool FindVar (const string &name) const
 Look up the variable among the stored ones. More...
 
IMacroVarGetVar (const string &name) const
 Return nullptr when the variable is not found. More...
 
bool GetNodeValue (const string &name, IQueryMacroUserObject &v) const
 Function fills in IQueryMacroUserObject-derived node out of stored variable. More...
 
const stringGetName () const
 Return macro name. More...
 
const stringGetTitle () const
 Return macro description. More...
 
const stringGetForEachString () const
 Return "for each" string. More...
 
const stringGetNamedAnnot () const
 Return "from" named annotation. More...
 
const TSeqRangeGetSeqRange () const
 Return sequence range. More...
 
CQueryParseTreeGetWhereClause () const
 Return "where" clause. More...
 
CQueryParseTreeGetDoTree () const
 Return "do" clause. More...
 
const stringGetThreadCount () const
 Return number of threads. More...
 
IMacroVarGetFirstVar (Int4 &block_num)
 Return functions for stored vars. More...
 
IMacroVarGetNextVar (Int4 &block_num)
 
bool HasIdentifier (const string &ident) const
 Return true if identifier is in datasource (only works if m_Exec not NULL) More...
 
CQueryParseTreeGetAssignmentWhereClause (int index) const
 
vector< CQueryParseTree * > GetAssignmentWhereClauses () const
 
bool AreThereGUIResolvableVars () const
 Return true if there are any GUI variables. More...
 
Int4 GetBlocksCount () const
 Get number of variable blocks. More...
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Attributes

static const string m_TopFuncName = "-TOP-DO-SECTION-"
 Name for top level function. More...
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 

Private Member Functions

void x_PrintTree (CNcbiOstream &os, CQueryParseTree *tree, const string &title, const string &separator) const
 Print a tree with a given header and separator. More...
 
IMacroVarx_FindVar (const string &name) const
 Locate the variable if it was stored. More...
 
TVariablesx_GetOrCreateLastBlock ()
 Helper function. It finds or creates a block for new variable. More...
 
 CMacroRep (const CMacroRep &)
 Prohibit copy constructor and assignment operator. More...
 
CMacroRepoperator= (const CMacroRep &)
 

Private Attributes

CQueryExecm_Exec { nullptr }
 Execution objection associated with this macro (may be NULL) More...
 
string m_Name
 Macro name. More...
 
string m_Title
 Macro title. More...
 
string m_KeyWords
 Meta keywords for search. More...
 
TVarBlocks m_VarBlocks
 Variables. More...
 
string m_Foreach
 For each string. More...
 
string m_NamedAnnot
 Named annotation. More...
 
TSeqRange m_SeqRange
 Sequence range. More...
 
unique_ptr< CQueryParseTreem_WhereTree
 Parsed Where-clause. More...
 
unique_ptr< CQueryParseTreem_DoTree
 Parsed function calls. More...
 
string m_NrThreads { "1" }
 Number of execution threads. More...
 
vector< CQueryParseTree * > m_FuncWhereClauses
 Vector of parsed function Where clauses. More...
 
string m_SourceText
 Macro source text. More...
 
Int4 m_NumOfVarBlocks
 Number of blocks of variables. More...
 
CQueryParseTree::TNodem_ActiveNode
 Active tree node in where clause. More...
 
bool m_GUIResolvable
 True if there is at least one GUI resolvable var. More...
 
TVariables::iterator m_VarIter
 
TVarBlocks::iterator m_BlockIter
 
Int4 m_BlockNumber
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Class for parsed macro representation.

stores internal binary macro representation and implements an interface for access to: Macro name Macro title (description) - optional ....Set of variables ....foreach selector - optional ....Which-clause tree ....Do-clause tree

Definition at line 253 of file macro_rep.hpp.


The documentation for this class was generated from the following files:
Modified on Sat Apr 20 12:19:46 2024 by modify_doxy.py rev. 669887