UniSet  2.6.0
Restorer.h
1 /*
2  * Copyright (c) 2015 Pavel Vainerman.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as
6  * published by the Free Software Foundation, version 2.1.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Lesser Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // --------------------------------------------------------------------------
21 // --------------------------------------------------------------------------
22 #ifndef Restorer_H_
23 #define Restorer_H_
24 // --------------------------------------------------------------------------
25 #include <memory>
26 #include <sigc++/sigc++.h>
27 #include <string>
28 #include "UniXML.h"
29 #include "UniSetTypes.h"
30 // --------------------------------------------------------------------------
31 namespace uniset
32 {
39  {
40  public:
41 
42  Restorer_XML();
43  virtual ~Restorer_XML();
44 
51  typedef sigc::slot<bool, const std::shared_ptr<UniXML>&, UniXML::iterator&, xmlNode*> ReaderSlot;
52 
64  void setReadItem( ReaderSlot sl );
65 
66 
78  void setReadConsumerItem( ReaderSlot sl );
79 
80 
84  void setItemFilter( const std::string& filterField, const std::string& filterValue = "" );
85 
89  void setConsumerFilter( const std::string& filterField, const std::string& filterValue = "" );
90 
91 
96  bool getConsumerInfo( UniXML::iterator& it,
97  uniset::ObjectId& cid, uniset::ObjectId& cnode );
98 
100  static xmlNode* find_node( const std::shared_ptr<UniXML>& xml, xmlNode* root, const std::string& nodename, const std::string& nm = "" );
101 
102  protected:
103 
104  virtual bool check_list_item( UniXML::iterator& it );
105  virtual bool check_consumer_item( UniXML::iterator& it );
106 
107  ReaderSlot rslot;
108  ReaderSlot cslot;
109 
110  std::string i_filterField = { "" };
111  std::string i_filterValue = { "" };
112  std::string c_filterField = { "" };
113  std::string c_filterValue = { "" };
114  };
115  // -------------------------------------------------------------------------
116 } // end of uniset namespace
117 // --------------------------------------------------------------------------
118 #endif
119 // --------------------------------------------------------------------------
Definition: CallbackTimer.h:29
Definition: UniXML.h:43
void setReadConsumerItem(ReaderSlot sl)
Definition: Restorer_XML.cc:151
void setConsumerFilter(const std::string &filterField, const std::string &filterValue="")
Definition: Restorer_XML.cc:51
static xmlNode * find_node(const std::shared_ptr< UniXML > &xml, xmlNode *root, const std::string &nodename, const std::string &nm="")
Definition: Restorer_XML.cc:123
void setItemFilter(const std::string &filterField, const std::string &filterValue="")
Definition: Restorer_XML.cc:45
sigc::slot< bool, const std::shared_ptr< UniXML > &, UniXML::iterator &, xmlNode * > ReaderSlot
Definition: Restorer.h:51
bool getConsumerInfo(UniXML::iterator &it, uniset::ObjectId &cid, uniset::ObjectId &cnode)
Definition: Restorer_XML.cc:57
Definition: Restorer.h:38
long ObjectId
Definition: UniSetTypes_i.idl:30
void setReadItem(ReaderSlot sl)
Definition: Restorer_XML.cc:146