File: class.cxx

package info (click to toggle)
cmtk 3.2.2-1.3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,428 kB
  • ctags: 11,670
  • sloc: cpp: 86,941; ansic: 23,347; sh: 3,896; xml: 1,551; perl: 700; makefile: 344
file content (84 lines) | stat: -rw-r--r-- 1,380 bytes parent folder | download | duplicates (18)
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
class foo_c : public bar_c		// Foo class derived from bar
{
  float	foo;				/* Real number */
  int	bar;				/* Integer */

  public:

  foo_c(float f, int b);
  ~foo_c();

  // 'get_bar()' - Get the value of bar.
  int // O - Value of bar
  get_bar()
  {
    return (bar);
  }

  // 'get_foo()' - Get the value of foo.
  float // O - Value of foo
  get_foo()
  {
    return (foo);
  }

  // 'set_bar()' - Set the value of bar.
  void
  set_bar(int b) // I - Value of bar
  {
    bar = b;
  }

  // 'set_foo()' - Set the value of foo.
  void
  set_foo(float f) // I - Value of foo
  {
    foo = f;
  }

  // 'set_foobar()' - Set foo and optionally bar (should show default args).
  void
  set_foobar(float f, // I - Value of foo
             int b = 0) // I - Value of bar
  {
    foo = f;
    bar = b;
  }

  protected:

  static int global;			/* Global integer */

  // 'get_global()' - Get the global integer.
  int // O - Integer
  get_global()
  {
    return (global);
  }

  private:

  int barfoo; // Another private integer

  public: 

  // 'get_barfoo()' - Get the barfoo value.
  int // O - Barfoo value
  get_barfoo()
  {
    return (barfoo);
  }
}

// 'foo_c::foo_c()' - Create a foo_c class.
foo_c::foo_c(float f, // I - Value of foo
             int b) // I - Value of bar
{
  foo = f;
  bar = b;
}

// 'foo_c::~foo_c()' - Destroy a foo_c class.
foo_c::~foo_c()
{
}