ddc
Public Member Functions | Public Attributes | List of all members
CQNegatable Class Reference

CQNegatable: negatable queries. More...

#include <Query.h>

Inheritance diagram for CQNegatable:
Inheritance graph
[legend]
Collaboration diagram for CQNegatable:
Collaboration graph
[legend]

Public Member Functions

 CQNegatable (const string &label=string(""), bool negated=false)
 Default constructor. More...
 
 CQNegatable (bool negated)
 
virtual ~CQNegatable ()
 
virtual bool Negate (void)
 toggle negation flag; returns new value More...
 
virtual bool Negated ()
 override returns current value of m_Negated More...
 
virtual string NegString (const std::string &s)
 string creation utility More...
 
virtual bool Compile (CQueryCompiler *compiler)
 override just calls m_Node->SetNegation(m_Negated) More...
 
virtual string jsonClass ()
 
virtual string jsonData ()
 
- Public Member Functions inherited from CQuery
 CQuery (const string &label=string(""))
 Default constructor. More...
 
virtual ~CQuery (void)
 
virtual bool CheckSatisfiable (CQueryCompiler *compiler)
 
virtual bool CompileOptions (CQueryCompiler *compiler=NULL)
 
virtual void Evaluate ()
 
virtual BYTE GetMatchId () const
 Get current match-id (should return a nontrivial match-id if any was used, else 0; default just returns 0) More...
 
virtual BYTE SetMatchId (BYTE matchId)
 Set match-id, returns new value. Default throws an exception. More...
 
virtual bool HasMatchId () const
 Returns true iff this query uses a nontrival match-id operator; default checks (this->GetMatchId() != 0) More...
 
virtual bool RootOK ()
 Is this query an admissible root of a compiled parse tree (default returns !this->Negated()) More...
 
virtual ddcObjectList Children () const
 
virtual void DisownChildren ()
 
virtual string toString ()
 DEBUG: return a canonical string form for this query (default just returns m_Label) More...
 
virtual string optionsToString ()
 DEBUG: return canonical option string More...
 
virtual string optionsToJson ()
 return json format option string More...
 
virtual string toJson ()
 
void SetCompiler (CQueryCompiler *compiler)
 
virtual void ClearNode ()
 deletes m_Node if non-NULL More...
 
virtual void ClearOptions ()
 deletes m_Options if non-NULL More...
 
virtual void Clear (bool deep=true)
 clear query contents. if deep is true, propagates operation to daughters More...
 
virtual void SetOptions (CQueryOptions *opts)
 set global query options ; deletes any pre-existing m_Options More...
 
- Public Member Functions inherited from ddcObject
 ddcObject ()
 Default constructor. More...
 
virtual ~ddcObject ()
 virtual destructor does nothing More...
 
template<typename Visit >
ddcObjectTraverse (Visit &visit)
 
template<typename Visit >
ddcObjectTraverse (Visit &visit) const
 
template<typename Visit >
ddcObjectTraverseR (Visit &visit)
 
template<typename Visit >
ddcObjectTraverseR (Visit &visit) const
 
virtual ddcObjectList Descendants () const
 

Public Attributes

bool m_Negated
 whether this query is negated More...
 
- Public Attributes inherited from CQuery
string m_Label
 arbitrary name for this query node (e.g. string from which it was parsed) More...
 
CQueryCompilerm_Compiler
 associated query compiler (only set on Compile()) More...
 
CQueryNodem_Node
 underlying CQueryNode (DDC-v1.x API) More...
 
CQueryOptionsm_Options
 root-level options (root queries only) More...
 
- Public Attributes inherited from ddcObject
void * m_User
 user data associated with this object (for use e.g. by perl wrappers) More...
 

Detailed Description

CQNegatable: negatable queries.

Constructor & Destructor Documentation

◆ CQNegatable() [1/2]

CQNegatable::CQNegatable ( const string &  label = string(""),
bool  negated = false 
)
inline

Default constructor.

◆ CQNegatable() [2/2]

CQNegatable::CQNegatable ( bool  negated)
inline

◆ ~CQNegatable()

virtual CQNegatable::~CQNegatable ( )
inlinevirtual

References CQuery::Negate().

Here is the call graph for this function:

Member Function Documentation

◆ Negate()

bool CQNegatable::Negate ( void  )
virtual

toggle negation flag; returns new value

Reimplemented from CQuery.

◆ Negated()

virtual bool CQNegatable::Negated ( )
inlinevirtual

override returns current value of m_Negated

Reimplemented from CQuery.

References CQuery::Compile().

Here is the call graph for this function:

◆ NegString()

string CQNegatable::NegString ( const std::string &  s)
virtual

string creation utility

◆ Compile()

bool CQNegatable::Compile ( CQueryCompiler compiler)
virtual

override just calls m_Node->SetNegation(m_Negated)

Reimplemented from CQuery.

Reimplemented in CQSeq, CQNear, CQToken, CQWithor, CQWithout, CQWith, CQOr, CQAnd, and CQBinOp.

References CQuery::m_Node, and CQueryNode::SetNegation().

Referenced by CQAnd::Compile(), CQOr::Compile(), CQWith::Compile(), CQWithout::Compile(), CQWithor::Compile(), CQToken::Compile(), CQNear::Compile(), and CQSeq::Compile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jsonClass()

virtual string CQNegatable::jsonClass ( void  )
inlinevirtual

◆ jsonData()

virtual string CQNegatable::jsonData ( void  )
inlinevirtual

instance data for json stringification

  • default implementation returns "NODATA":1, for strict syntax compliance

Reimplemented from CQuery.

Reimplemented in CQSeq, CQNear, CQTokInfl, CQToken, CQWith, and CQBinOp.

Referenced by CQBinOp::jsonData(), CQToken::jsonData(), CQNear::jsonData(), and CQSeq::jsonData().

Here is the caller graph for this function:

Member Data Documentation

◆ m_Negated

bool CQNegatable::m_Negated

whether this query is negated


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