summaryrefslogtreecommitdiff
path: root/docs/module-doc/classExtensible.html
blob: c4bc42abe1c9c54ca3e0c2b6ca9c518aa5ce1718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>InspIRCd: Extensible class Reference</title>
<link href="inspircd.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>Extensible Class Reference</h1>class Extensible is the parent class of many classes such as userrec and chanrec.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="base_8h-source.html">base.h</a>&gt;</code>
<p>
Inheritance diagram for Extensible:<p><center><img src="classExtensible__inherit__graph.gif" border="0" usemap="#Extensible__inherit__map" alt="Inheritance graph"></center>
<map name="Extensible__inherit__map">
<area href="classchanrec.html" shape="rect" coords="8,157,77,184" alt="">
<area href="classcommand__t.html" shape="rect" coords="101,157,192,184" alt="">
<area href="classconnection.html" shape="rect" coords="216,157,301,184" alt="">
<area href="classircd__connector.html" shape="rect" coords="325,157,434,184" alt="">
<area href="classclassbase.html" shape="rect" coords="162,8,242,34" alt="">
<area href="classserverrec.html" shape="rect" coords="172,232,249,258" alt="">
<area href="classuserrec.html" shape="rect" coords="273,232,340,258" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Extensible:<p><center><img src="classExtensible__coll__graph.gif" border="0" usemap="#Extensible__coll__map" alt="Collaboration graph"></center>
<map name="Extensible__coll__map">
<area href="classclassbase.html" shape="rect" coords="7,98,87,125" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classExtensible-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classExtensible.html#a0">Extend</a> (std::string key, char *p)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Extend an Extensible class. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classExtensible.html#a1">Shrink</a> (std::string key)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shrink an Extensible class. </em> <a href="#a1"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>char *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classExtensible.html#a2">GetExt</a> (std::string key)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get an extension item. </em> <a href="#a2"></a><em><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>std::map&lt; std::string, char * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classExtensible.html#r0">Extension_Items</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Private data store. </em> <a href="#r0"></a><em><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
class Extensible is the parent class of many classes such as userrec and chanrec. 
<p>
class Extensible implements a system which allows modules to 'extend' the class by attaching data within a map associated with the object. In this way modules can store their own custom information within user objects, channel objects and server objects, without breaking other modules (this is more sensible than using a flags variable, and each module defining bits within the flag as 'theirs' as it is less prone to conflict and supports arbitary data storage). 
<p>

<p>
Definition at line <a class="el" href="base_8h-source.html#l00050">50</a> of file <a class="el" href="base_8h-source.html">base.h</a>.<hr><h2>Member Function Documentation</h2>
<a name="a0" doxytag="Extensible::Extend"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool Extensible::Extend </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::string&nbsp;</td>
          <td class="mdname" nowrap> <em>key</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap> <em>p</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extend an Extensible class. 
<p>
You must provide a key to store the data as, and a void* to the data (typedef VoidPointer) The data will be inserted into the map. If the data already exists, you may not insert it twice, <a class="el" href="classExtensible.html#a0">Extensible::Extend</a> will return false in this case. On successful extension, Extend returns true.    </td>
  </tr>
</table>
<a name="a2" doxytag="Extensible::GetExt"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> char* Extensible::GetExt </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::string&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>key</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get an extension item. 
<p>
You must provide a key name, which is case sensitive. If you provide a non-existent key name, the function returns NULL, otherwise a pointer to the item referenced by the key is returned.    </td>
  </tr>
</table>
<a name="a1" doxytag="Extensible::Shrink"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool Extensible::Shrink </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::string&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>key</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Shrink an Extensible class. 
<p>
You must provide a key name. The given key name will be removed from the classes data. If you provide a nonexistent key (case is important) then the function will return false. Returns true on success.    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a name="r0" doxytag="Extensible::Extension_Items"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> std::map&lt;std::string,char*&gt; <a class="el" href="classExtensible.html#r0">Extensible::Extension_Items</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Private data store. 
<p>

<p>
Definition at line <a class="el" href="base_8h-source.html#l00054">54</a> of file <a class="el" href="base_8h-source.html">base.h</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="base_8h-source.html">base.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri May 13 01:59:41 2005 for InspIRCd by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.3 </small></address>
</body>
</html>