RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
Token.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Token class. Defines a token of the grammar to be used by the parser.
14
15#ifndef _RBT_TOKEN_H_
16#define _RBT_TOKEN_H_
17
18#include "rxdock/Commands.h"
19#include "rxdock/Config.h"
20#include "rxdock/Vble.h"
21
22#include <nlohmann/json.hpp>
23
24using json = nlohmann::json;
25
26namespace rxdock {
27
28class Token {
29public:
30 static const std::string _CT;
32 // Constructors
34
35 Token(const Vble &);
37 Token(const Token &);
38
40 // Destructor
42 virtual ~Token();
43
44 friend void to_json(json &j, const Token &token);
45 friend void from_json(const json &j, Token &token);
46
47 const Vble &GetVble() const;
48 // void SetVbleNumber(Int);
49
50 // void copy(const Token &);
51 bool IsVble();
52 bool IsLog();
53 bool IsExp();
54 bool IsAdd();
55 bool IsSub();
56 bool IsMul();
57 bool IsDiv();
58 bool IsAnd();
59 bool IsIf();
60
61 // Bool operator==(const Token&) const;
62 // std::ostream& Print(std::ostream&) const;
63 // friend std::ostream& operator<<(std::ostream& s, const Token &p);
64
66 // Private methods
68
69private:
70 Token(); // Default constructor disabled
71 Commands comm;
72 const Vble &vble;
73 bool isvble;
74};
75
76void to_json(json &j, const Token &token);
77void from_json(const json &j, Token &token);
78
79// Useful typedefs
80typedef SmartPtr<Token> TokenPtr; // Smart pointer
81typedef std::vector<TokenPtr> TokenList; // Vector of smart pointers
82typedef TokenList::iterator TokenListIter;
83typedef TokenList::const_iterator TokenListConstIter;
84
85// Compare class to compare different genomes inside a population
86// This is used to sort the genomes in a population depending
87// of the value of their scoring function.
88
89} // namespace rxdock
90
91#endif //_Token_H_
Definition Commands.h:20
Definition SmartPointer.h:48
Definition Token.h:28
Definition Vble.h:22