File: container.h.html

package info (click to toggle)
rudiments 0.32-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,932 kB
  • ctags: 3,047
  • sloc: cpp: 23,013; sh: 7,769; ansic: 1,769; makefile: 1,057; xml: 169; perl: 19
file content (75 lines) | stat: -rw-r--r-- 4,991 bytes parent folder | download | duplicates (2)
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
<html>
<head>
<title>~/src/firstworks/rudiments-0.28/include/rudiments/container.h.html</title>
<meta name="Generator" content="Vim/6.3">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2004 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a520f7">#ifndef RUDIMENTS_CONTAINER_H</font>
<font color="#a520f7">#define RUDIMENTS_CONTAINER_H</font>

<font color="#a520f7">#include </font><font color="#ff00ff">&lt;rudiments/private/containerincludes.h&gt;</font>

<font color="#0000ff">// The container class provides base class for classes which store related data.</font>

<font color="#a520f7">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#298a52"><b>namespace</b></font> rudiments {
<font color="#a520f7">#endif</font>

<font color="#298a52"><b>class</b></font> container {
        <font color="#a52829"><b>public</b></font>:
                        container();
                <font color="#298a52"><b>virtual</b></font> ~container();

                <font color="#0000ff">// These methods control the behavior of the setter methods.</font>
                <font color="#298a52"><b>void</b></font>    copyReferences();
                        <font color="#0000ff">// Instructs the setter methods to copy the values</font>
                        <font color="#0000ff">// passed into them rather than just keeping track</font>
                        <font color="#0000ff">// of the pointers.</font>
                <font color="#298a52"><b>void</b></font>    dontCopyReferences();
                        <font color="#0000ff">// Instructs the setter methods to just keep track</font>
                        <font color="#0000ff">// of pointers passed into them rather than copying</font>
                        <font color="#0000ff">// the values.</font>

                <font color="#0000ff">// These methods control the behavior when the container</font>
                <font color="#0000ff">// is deleted.</font>
                <font color="#298a52"><b>void</b></font>    cascadeOnDelete();
                        <font color="#0000ff">// Instructs the destructor to call delete or delete[]</font>
                        <font color="#0000ff">// (as appropriate) on whatever data is contained in</font>
                        <font color="#0000ff">// the class.</font>
                <font color="#298a52"><b>void</b></font>    dontCascadeOnDelete();
                        <font color="#0000ff">// Instructs the destructor not to call delete or</font>
                        <font color="#0000ff">// delete[] (as appropriate) on whatever data is</font>
                        <font color="#0000ff">// contained in the class.  This is the default.</font>

                <font color="#298a52"><b>virtual</b></font> <font color="#298a52"><b>bool</b></font>    save(<font color="#298a52"><b>const</b></font> filedescriptor *fd);
                <font color="#298a52"><b>virtual</b></font> <font color="#298a52"><b>bool</b></font>    save(<font color="#298a52"><b>const</b></font> <font color="#298a52"><b>unsigned</b></font> <font color="#298a52"><b>char</b></font> *buffer);
                                <font color="#0000ff">// Writes a representation of the data in the</font>
                                <font color="#0000ff">// container out to the filedescriptor or</font>
                                <font color="#0000ff">// buffer.</font>
                                <font color="#0000ff">//</font>
                                <font color="#0000ff">// Returns true on success and false on failure.</font>
                <font color="#298a52"><b>virtual</b></font> <font color="#298a52"><b>bool</b></font>    load(<font color="#298a52"><b>const</b></font> filedescriptor *fd);
                <font color="#298a52"><b>virtual</b></font> <font color="#298a52"><b>bool</b></font>    load(<font color="#298a52"><b>const</b></font> <font color="#298a52"><b>unsigned</b></font> <font color="#298a52"><b>char</b></font> *buffer);
                                <font color="#0000ff">// Loads the data from filedescriptor or buffer.</font>
                                <font color="#0000ff">// Replaces data currently stored in the</font>
                                <font color="#0000ff">// container and implies copyReferences() and</font>
                                <font color="#0000ff">// cascadeOnDelete().</font>
                                <font color="#0000ff">//</font>
                                <font color="#0000ff">// Returns true on success and false on failure.</font>

<font color="#a520f7">        #include </font><font color="#ff00ff">&lt;rudiments/private/container.h&gt;</font>
};

<font color="#a520f7">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a520f7">#endif</font>

<font color="#a520f7">#endif</font>
</pre>
</body>
</html>