////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This is a part of the COM Serialization SDK VC++ Library.
//  
// Copyright 2009 BPM Microsystems
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//                                                                                                                    //
// $Header: //sesca/src/Winprog/COMSerializationSDK/VC++/HeaderLib/ComSerSdk/Detail/rcs/ApplicationBase.h 1.2 2009/08/17 11:09:16 arturoc Exp $
//                                                                                                                    //
///////// 120 columns, Tab = Insert 3 Spaces ///////////////////////////////////////////////////////////////////////////

/**
   This header file defines the CApplicationBase class.
*/

#pragma once

#include "Server.h"

namespace ComSerSdk
{

/**
   The base for the library-user's application class that is responsible for creating the server class instance.
   Consult the COM Serialization SDK documentation for details.
*/
class CApplicationBase
{
   /**
      Allow only the COM coclass to access the CreateServer() member function.
   */
   friend class ComSerSdk::Detail::COMSERSDK_ESS_CPP_CLASS_NAME;

public:
   
   /**
      Registers ourselves with the ComSerSdk_Detail_CSerializationModule instance.
   */
   CApplicationBase()
   {
      _AtlModule.SetApp(this);
   }
private:

   /**
      The library user should override this to provide a pointer to their server class allocated on the heap.
      Consult the COM Serialization SDK documentation for details.
   */
   virtual CServerPtr CreateServer() = 0;
};
}// end namespace ComSerSdk