iceWing
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
icemm
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
:
18
plugData
*
data
;
19
public
:
20
PluginData
() :
data
(NULL) {
21
}
22
PluginData
(
plugData
* pd) :
data
(pd) {
23
plug_data_ref
(
data
);
24
};
25
26
PluginData
(
const
PluginData
& o) :
data
(o.
data
) {
27
plug_data_ref
(
data
);
28
}
29
~PluginData
() {
30
plug_data_unget
(
data
);
31
data
= NULL;
32
}
33
34
std::string
id
()
const
{
35
return
std::string(this->
get
()->ident);
36
}
37
38
plugData
&
operator *
() {
39
return
*
data
;
40
}
41
const
plugData
&
operator*
()
const
{
42
return
*
data
;
43
}
44
plugData
*
operator ->
() {
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
65
PluginData
&
operator=
(
const
PluginData
& o) {
66
if
(
data
!= NULL)
67
plug_data_unget
(
data
);
68
data
= o.
data
;
69
plug_data_ref
(
data
);
70
return
*
this
;
71
}
72
};
73
}
// namespace ICEWING
74
75
#endif
/* _PLUGINDATA_HPP */
76
Generated by
1.8.1