Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / POA / Default_Servant2 / File_i.h
blob5a2faf71ea3784da4ed12e3f2b3b8a7a7a63af1f
2 //=============================================================================
3 /**
4 * @file File_i.h
6 * Defines the implementation classes for the File IDL
7 * module
9 * @author Irfan Pyarali
11 //=============================================================================
14 #include "FileS.h"
16 /**
17 * @class FileImpl
19 * @brief FileImpl class provides the namespace for the File IDL module .
21 class FileImpl
23 public:
24 /**
25 * @class Descriptor
27 * @brief Descriptor implements the Descriptor interface in the File
28 * Module A single Descriptor servant can serve multiple object
29 * references
31 class Descriptor : public POA_File::Descriptor
33 public:
34 /// Constructor
35 Descriptor (PortableServer::POA_ptr poa);
37 /// Destructor
38 ~Descriptor ();
40 /// Returns the default POA of this object
41 PortableServer::POA_ptr _default_POA ();
43 /// write buffer to File corresponding to this Descriptor
44 virtual CORBA::Long write (const File::Descriptor::DataBuffer &buffer);
46 virtual File::Descriptor::DataBuffer *read (CORBA::Long num_bytes);
48 /// seek to the offset in file from whence
49 virtual CORBA::ULong lseek (CORBA::ULong offset,
50 CORBA::Long whence);
52 /// closes the file corresponding to the requested ObjectID
53 virtual void destroy ();
55 private:
56 /// Extracts the ACE_HANDLE from the objectID
57 ACE_HANDLE fd ();
59 PortableServer::POA_var poa_;
62 /**
63 * @class System
65 * @brief File System implementation class.
67 class System : public POA_File::System
69 public:
70 /// Constructor, Creates a single File Descriptor Servant and
71 /// registers it with the POA as the Default Servant
72 System (CORBA::ORB_ptr orb,
73 PortableServer::POA_ptr poa);
75 ///Destructor
76 ~System ();
78 ///Returns the default POA of this object
79 PortableServer::POA_ptr _default_POA ();
81 /// Opens a file ,creates a Descriptor reference with the
82 /// ACE_HANDLE and returns that reference
83 File::Descriptor_ptr open (const char *file_name,
84 CORBA::Long flags);
86 void shutdown ();
87 private:
88 CORBA::ORB_var orb_;
90 PortableServer::POA_var poa_;
92 /// The single File Descriptor servant which serves requests for
93 /// any Descriptor object under poa_.
94 Descriptor fd_servant_;