iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
PluginData.hpp
Go to the documentation of this file.
1 /*
2  * File: PluginData.hpp
3  * Author: iluetkeb
4  *
5  * Created on 30. September 2008, 13:09
6  */
7 
8 #ifndef _PLUGINDATA_HPP
9 #define _PLUGINDATA_HPP
10 
11 #include <string>
12 #include <main/plugin_comm.h>
13 
14 namespace ICEWING {
15  // do iceWing reference counting using C++ ctor/dtor
16  class PluginData {
17  protected:
19  public:
20  PluginData() : data(NULL) {
21  }
22  PluginData(plugData* pd) : data(pd) {
24  };
25 
26  PluginData(const PluginData& o) : data(o.data) {
28  }
31  data = NULL;
32  }
33 
34  std::string id() const {
35  return std::string(this->get()->ident);
36  }
37 
39  return *data;
40  }
41  const plugData& operator* () const {
42  return *data;
43  }
45  return data;
46  }
47  const plugData* operator ->() const {
48  return data;
49  }
50 
51  plugData* get() {
52  return data;
53  }
54  const plugData* get() const {
55  return data;
56  }
57 
58  operator bool() const {
59  return data != NULL;
60  }
61  bool operator !() const {
62  return data == NULL;
63  }
64 
66  if(data != NULL)
68  data = o.data;
70  return *this;
71  }
72  };
73 } // namespace ICEWING
74 
75 #endif /* _PLUGINDATA_HPP */
76