Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / nestea_i.h
blob2c713a6e7d380a5a6d70eb0b7de034695aeaf324
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file nestea_i.h
7 * This class is an implementation of the Nestea Bookshelf interface.
9 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
11 //=============================================================================
14 #if !defined (NESTEA_I_H)
15 #define NESTEA_I_H
17 #include "NesteaS.h"
19 // Forward declarations.
20 class Nestea_i;
22 // Typedefs.
23 typedef Nestea_i *Nestea_i_ptr;
24 typedef Nestea_i_ptr Nestea_i_ref;
26 /**
27 * @class Nestea_i:
29 * @brief Nestea Bookshelf Implementation
31 * Implements the Nestea Bookshelf server, which keeps track of the
32 * number of nestea cans in a bookshelf. You can drink Nestea to add
33 * it to the bookshelf or crush the cans to remove them.
35 class Nestea_i: public POA_Nestea_Bookshelf
37 public:
38 /// Constructor
39 Nestea_i (CORBA::ORB_ptr orb, const ACE_TCHAR *filename = ACE_TEXT("nestea.dat"));
41 /// Destructor
42 virtual ~Nestea_i ();
44 /// Add <cans> number of cans to the bookshelf.
45 virtual void drink (CORBA::Long cans);
47 /// Removes <cans> number of cans from the bookshelf.
48 virtual void crush (CORBA::Long cans);
50 /// Returns the number of cans in the bookshelf.
51 virtual CORBA::Long bookshelf_size ();
53 /// Returns comments about your collection.
54 virtual char *get_praise ();
56 virtual void shutdown();
57 private:
58 /// Saves bookshelf data to a file.
59 int save_data ();
61 /// Loads bookshelf data from a file.
62 int load_data ();
64 /// The name of the file to store the data in.
65 ACE_TCHAR *data_filename_;
67 /// Number of cans in the bookshelf.
68 ACE_UINT32 cans_;
70 CORBA::ORB_var orb_;
73 #endif /* NESTEA_I_H */