AimlFacade Class Reference

Facade to manage the memory allocation and deallocation of concrete objects that have publicly exposed interfaces as well as provide get'ers to the concerte objects using their exposed interfaces. More...

#include <AimlFacade.h>

List of all members.

Public Member Functions

 AimlFacade () throw (Exception &)
 Constructs the facade and all the concrete objects to the interfaces that have get'ers.
GraphBuildergetGraphBuilder () throw ()
 Returns the constructed GraphBuilder object from AimlFacade's constructor.
void operator delete (void *p)
 All delete's will be handled through this dll.
void * operator new (unsigned int size)
 All new's will be handled through this dll.
virtual ~AimlFacade ()
 Destructs the facade and all the concrete objects to the interfaces that have get'ers.

Private Member Functions

 AimlFacade (const AimlFacade &aimlFacade)
 The copy constructor.
AimlFacadeoperator= (const AimlFacade &aimlFacade)
 The assignment operator.

Private Attributes

GraphBuilderm_graphBuilder
 The GraphBuilder pointer.


Detailed Description

Facade to manage the memory allocation and deallocation of concrete objects that have publicly exposed interfaces as well as provide get'ers to the concerte objects using their exposed interfaces.

AimlFacade manages the memory for the GraphBuilder object. When AimlFacade is instantiated it creates the GraphBuilder concerte implementation with a "new" and stores it inside of its pointer to the GraphBuilder interface, m_graphBuilder. When AimlFacade is destroyed it in turn destroys the GraphBuilder object through this same pointer.

This indirection is needed since GraphBuilder is an interface and users cannot directly instantiate it without access to a concrete implementation.

Since AimlFacade creates and deletes the GraphBuilder object from the heap with a "new", the memory management stays inside of the dll. This is a requirement for "dll memory boundary safety".


Constructor & Destructor Documentation

AimlFacade  )  throw (Exception &)
 

Constructs the facade and all the concrete objects to the interfaces that have get'ers.

Underneath the covers the constructor creates a factory and from that factor creates the GraphBuilder concrete representation and stores it in the m_graphBuilder pointer.

Exceptions:
This constuctor will not explicitly throw an exception. However, an underlying method or function could. More than likely, the only exception that would be thrown would be an out of memory exception (bad_alloc exception).

virtual ~AimlFacade  )  [virtual]
 

Destructs the facade and all the concrete objects to the interfaces that have get'ers.

Underneath the covers it deletes the GraphBuilder and its respective factory which created it.

AimlFacade const AimlFacade aimlFacade  )  [private]
 

The copy constructor.

For now, I am not allowing this to be invoked. In the future, if I do, it will more than likely be a shallow copy since it could be potentially expensive to do a deep copy of the GraphBuilder object.

Parameters:
aimlFacade The standard second reference


Member Function Documentation

GraphBuilder& getGraphBuilder  )  throw ()
 

Returns the constructed GraphBuilder object from AimlFacade's constructor.

The GraphBuilder object and memory is constructed in the AimlFacade constructor and destoryed in the AimlFacade destructor. DO NOT try to delete GraphBuilder yourself. Instead let AimlFacade auotmagically handle the construction and deletion of GraphBuilder.

Returns:
The GraphBuilder constructed in the AimlFacade constructor.
Exceptions:
No exceptions will be thrown.

void operator delete void *  p  ) 
 

All delete's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "new operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
p The pointer to an instance of this object.

void* operator new unsigned int  size  ) 
 

All new's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "delete operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
size The size to allocate an instance of this object with.
Returns:
An instance of this object

AimlFacade& operator= const AimlFacade aimlFacade  )  [private]
 

The assignment operator.

For now, I am not allowing a copy to be made. In the future, if I do, it will more than likely be a shallow copy since it could be potentially expensive to do a deep copy of the GraphBuilder object.

Parameters:
aimlFacade The standard second reference.


Member Data Documentation

GraphBuilder* m_graphBuilder [private]
 

The GraphBuilder pointer.

Use AimlFacade::getGraphBuilder to obtain a reference to this. The GraphBuilder object is constructed in the constructor of AimlFacade and deleted in the destructor of AimlFacade. DO NOT try to delete this yourself. Let AimlFacade handle the memory of this for "dll memory boundary safety".


The documentation for this class was generated from the following file:
Generated on Tue Apr 4 23:38:48 2006 for RebeccaAIML by  doxygen 1.4.5