summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/ImplRepo/nestea_i.h
blob: f9229a39fd59de8aab1eda89ddd94824ee721a5e (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
// -*- C++ -*-
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/tests/ImplRepo
// 
// = FILENAME
//    nestea_i.h
//
// = DESCRIPTION
//    This class is an implementation of the Nestea Bookshelf interface.
//
// = AUTHOR
//    Darrell Brunsch <brunsch@cs.wustl.edu>
// 
// ============================================================================

#if !defined (NESTEA_I_H)
#define	NESTEA_I_H

#include "NesteaS.h"

// Forward declarations.
class Nestea_i;

// Typedefs.
typedef Nestea_i *Nestea_i_ptr;
typedef Nestea_i_ptr Nestea_i_ref;

class Nestea_i: public POA_Nestea_Bookshelf
{
  // = TITLE
  //    Nestea Bookshelf Implementation
  //
  // = DESCRIPTION
  //    Implements the Nestea Bookshelf server, which keeps track of the
  //    number of nestea cans in a bookshelf.  You can drink Nestea to add
  //    it to the bookshelf or crush the cans to remove them.
public:
  Nestea_i (int shutdown = 0);
  // Constructor that takes in an optional shutdown parameter which, if nonzero,
  // will shutdown the server after each call.

  virtual ~Nestea_i (void);
  // Destructor

  virtual void drink (CORBA::Long cans,
                      CORBA::Environment &ACE_TRY_ENV = 
                        CORBA::Environment::default_environment ());
  // Add <cans> number of cans to the bookshelf.

  virtual void crush (CORBA::Long cans,
                      CORBA::Environment &ACE_TRY_ENV = 
                        CORBA::Environment::default_environment ());
  // Removes <cans> number of cans from the bookshelf.

  virtual CORBA::Long bookshelf_size (CORBA::Environment &ACE_TRY_ENV = 
                                        CORBA::Environment::default_environment ());
  // Returns the number of cans in the bookshelf.

  virtual char *get_praise (CORBA::Environment &ACE_TRY_ENV = 
                              CORBA::Environment::default_environment ());
  // Returns comments about your collection.

private:
  int shutdown_;
  // Shutdown flag.

  CORBA::Long cans_;
  // Number of cans in the bookshelf.
};

#endif /* NESTEA_I_H */