Definition at line 24 of file Callback.h.
◆ Callback()
◆ ~Callback()
◆ add()
int add |
( |
NSMVHandler * |
handler, |
|
|
bool |
overwrite = true , |
|
|
bool |
isdump = true |
|
) |
| |
Definition at line 25 of file Callback.cc.
26{
27 if (handler) {
28 std::string hname = handler->getNode() + "@" + handler->getName();
29 if (m_handler.find(hname) != m_handler.end()) {
30 NSMVHandler* handler_old = m_handler.find(hname)->second;
31 if (handler->useSet() && overwrite) {
32 handler->set(handler_old->get());
33 }
34 delete handler_old;
35 m_handler.erase(hname);
36 }
37 handler->setDumped(isdump);
38 m_handler.insert(std::pair<std::string, NSMVHandler*>(hname, handler));
39 m_hnames.push_back(hname);
40 return m_handler.size();
41 }
42 return 0;
43}
◆ getHandler() [1/2]
Definition at line 42 of file Callback.h.
43 {
44 return getHandler("", name);
45 }
◆ getHandler() [2/2]
NSMVHandler & getHandler |
( |
const std::string & |
node, |
|
|
const std::string & |
name |
|
) |
| |
Definition at line 56 of file Callback.cc.
58{
60 if (p != NULL) return *p;
61 throw (std::out_of_range(StringUtil::form("no handler for %s:%s",
62 node.c_str(), name.c_str())));
63}
◆ getHandler_p()
NSMVHandler * getHandler_p |
( |
const std::string & |
node, |
|
|
const std::string & |
name |
|
) |
| |
|
private |
Definition at line 65 of file Callback.cc.
66{
67 std::string hname = node + "@" + name;
68 if (m_handler.find(hname) != m_handler.end()) {
69 return m_handler.find(hname)->second;
70 }
71 hname = "@" + name;
72 if (m_handler.find(hname) != m_handler.end()) {
73 return m_handler.find(hname)->second;
74 }
75 return NULL;
76}
◆ getHandlerNames()
StringList & getHandlerNames |
( |
| ) |
|
|
inline |
◆ getHandlers()
NSMVHandlerList & getHandlers |
( |
| ) |
|
|
inline |
◆ getRevision()
int getRevision |
( |
| ) |
const |
|
inline |
◆ remove() [1/3]
Definition at line 78 of file Callback.cc.
79{
80 DBObject::NameValueList list;
81 obj.search(list, "", true);
82 for (DBObject::NameValueList::iterator it = list.begin();
83 it != list.end(); ++it) {
84 const std::string& name(it->name);
85 if (name.size() == 0 || name.at(0) == '$') continue;
86 switch (it->type) {
87 case DBField::OBJECT:
88 break;
89 default:
90 remove(name);
91 break;
92 }
93 }
94}
◆ remove() [2/3]
void remove |
( |
const std::string & |
name | ) |
|
|
inline |
◆ remove() [3/3]
void remove |
( |
const std::string & |
node, |
|
|
const std::string & |
name |
|
) |
| |
Definition at line 45 of file Callback.cc.
46{
47 std::string hname = node + "@" + node;
48 if (m_handler.find(hname) != m_handler.end()) {
49 NSMVHandler* handler_old = m_handler.find(hname)->second;
50 delete handler_old;
51 m_handler.erase(hname);
52 return;
53 }
54}
◆ reset()
Definition at line 14 of file Callback.cc.
15{
16 for (NSMVHandlerList::iterator it = m_handler.begin();
17 it != m_handler.end(); ++it) {
18 if (it->second != NULL) delete it->second;
19 }
20 m_handler = NSMVHandlerList();
21 m_hnames = StringList();
22 return ++m_revision;
23}
◆ setRevision()
void setRevision |
( |
int |
revision | ) |
|
|
inline |
Definition at line 58 of file Callback.h.
58{ m_revision = revision; }
◆ setUseGet()
void setUseGet |
( |
const std::string & |
name, |
|
|
bool |
use |
|
) |
| |
|
inline |
Definition at line 48 of file Callback.h.
49 {
50 getHandler(name).setUseGet(use);
51 }
◆ setUseSet()
void setUseSet |
( |
const std::string & |
name, |
|
|
bool |
use |
|
) |
| |
|
inline |
Definition at line 52 of file Callback.h.
53 {
54 getHandler(name).setUseSet(use);
55 }
◆ AbstractNSMCallback
◆ NSMCallback
◆ m_handler
NSMVHandlerList m_handler |
|
private |
◆ m_hnames
◆ m_revision
The documentation for this class was generated from the following files: