17#ifndef _RBT_CONTEXT_H_
18#define _RBT_CONTEXT_H_
20#include "rxdock/BaseSF.h"
21#include "rxdock/DockingSite.h"
22#include "rxdock/Model.h"
23#include "rxdock/Vble.h"
24#include "rxdock/geneticprogram/GPTypes.h"
29typedef std::map<std::string, VblePtr> StringVbleMap;
30typedef std::map<int, VblePtr> IntVbleMap;
31typedef StringVbleMap::iterator StringVbleMapIter;
32typedef IntVbleMap::iterator IntVbleMapIter;
36 static const std::string _CT;
46 virtual void Assign(std::string, ReturnType) = 0;
47 virtual void Assign(
int, ReturnType) = 0;
48 virtual const Vble &GetVble(
int) = 0;
49 virtual const Vble &GetVble(std::string) = 0;
50 virtual void SetVble(
int key,
const Vble &v) = 0;
64 void Assign(
int key, ReturnType val) {
65 IntVbleMapIter it = vm.find(key);
67 vm[key]->SetValue(val);
69 vm[key] =
new Vble(std::to_string(val), val);
72 void Assign(std::string s, ReturnType val) {
73 throw Error(_WHERE_,
"This is not a string context");
79 const Vble &GetVble(
int key) {
return *(vm[key]); }
80 void SetVble(
int key,
const Vble &v) { *(vm[key]) = v; }
81 const Vble &GetVble(std::string key) {
82 throw Error(_WHERE_,
"This is not a string context");
99 void Assign(std::string key, ReturnType val) {
100 StringVbleMapIter it = vm.find(key);
102 vm[key]->SetValue(val);
104 vm[key] =
new Vble(key, val);
107 void Assign(
int i, ReturnType val) {
108 throw Error(_WHERE_,
"This is not a cell context");
115 double Get(
ModelPtr lig, std::string name);
118 const Vble &GetVble(std::string key) {
return *(vm[key]); }
119 const Vble &GetVble(
int key) {
120 throw Error(_WHERE_,
"This is not a cell context");
122 void SetVble(
int key,
const Vble &v) { *(vm[
""]) = v; }
133typedef std::vector<CellContextPtr> CellContextList;
135typedef CellContextList::iterator CellContextListIter;
136typedef CellContextList::const_iterator CellContextListConstIter;
138typedef std::vector<StringContextPtr>
140typedef StringContextList::iterator StringContextListIter;
141typedef StringContextList::const_iterator StringContextListConstIter;
143typedef std::vector<ContextPtr> ContextList;
144typedef ContextList::iterator ContextListIter;
145typedef ContextList::const_iterator ContextListConstIter;
Definition SmartPointer.h:48