![]() |
|
Use this task to add declarations for class variables, constructors, and destructors for a CORBA servant class to its skeleton implementation header file, servant.ih. This defines any private variables for the implementation code in the associated servant_I.cpp file.
This task follows on from the task to compile the servant.idl file that defines the public interface for the server implementation class. For more information about compiling the IDL file, which creates the servant.ih file, see Compiling the servant IDL (using idlc).
To add declarations for class variables, constructors, and destructors to an implementation header file,servant.ih, complete the following steps:
Interface declaration in WSLogger.idl | Implementation header in WSLogger.ih |
---|---|
interface WSLogger { void setFileName(in string newFileName); string getFileName(); void setMethodName( in string newMethodName ); string getMethodName(); short openLogFile(); short closeLogFile(); short writeLogMessage(in string newMessage, in short newSeverity); const short DMY_DATE_FORMAT = 1; const short MDY_DATE_FORMAT = 2; void setDateFormat(in unsigned short newDateFormat); unsigned short getDateFormat(); }; |
class WSLogger_Impl : public virtual ::WSLogger_Skeleton { public: ::CORBA::Void setFileName (const char* newFileName); char* getFileName (); ::CORBA::Void setMethodName (const char* newMethodName); char* getMethodName (); ::CORBA::Short openLogFile (); ::CORBA::Short closeLogFile (); ::CORBA::Short writeLogMessage (const char* newMessage, ::CORBA::Short newSeverity); ::CORBA::Void setDateFormat (::CORBA::UShort newDateFormat); ::CORBA::UShort getDateFormat (); private: char * fileName; char * methodName; ::CORBA::UShort dateFormat; ofstream logFile; ::CORBA::UShort logFileOpen; public: WSLogger_Impl( char * newFileName ); virtual ~WSLogger_Impl(); }; |
You can next add code to skeleton implementation definition, servant_I.cpp, to implement the business logic, as described in Completing the server implementation (server_I.cpp).
This task is one step of the parent task, Developing a CORBA server.
![]() |
![]() |