Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATPlatform Class Reference

CATPlatform Class Reference
[Common Accessibility Technology [CAT] library]

#include <CATPlatform.h>

List of all members.


Detailed Description

Platform-specific object creation.

When a base class needs more than a few members that are platform- specific, it can get downright fugly to use ifdef. CATPlatform tries to solve this problem.

For such classes, create a pure virtual interface class. Then, create a child class for each platform. Then, include the pure virtual class in whatever source you need to create such an object in and include CATPlatform. When you need the object, acquire it from CATPlatform by calling Get[ClassName]() - CATPlatform will create your object for you.

You can then use it using the pure interface. To free it, call CATPlatform::Release() on the object.

Note: Currently, most of the classes done this way are NOT reference counted. Instead, you get an actual new object each time, then it really goes away when you call CATPlatform::Release(). Don't try tricky copying stuff and expect the copy to work after you release the original or vise- versa. In the future, some objects may be made singleton or reference counted here, however. Your best bet is to call the Get* functions when you need an object, and the Release() when you're done with it - leave system-wide optimizations to the CATPlatform object.

Release() also sets the incoming referenced pointer to NULL to discourage hanging pointer errors.

There is no CATPlatform.cpp. Instead, for each platform, there is a seperate CATPlatform_PLATFORM.cpp file. Only place the appropriate platform file in your project (or exclude the others from compile).

Definition at line 55 of file CATPlatform.h.


Public Member Functions

 CATPlatform ()
virtual ~CATPlatform ()
CATFileSystemGetFileSystem (const CATString &basePath="")
void Release (CATFileSystem *&fileSys)

The documentation for this class was generated from the following files:
Generated on Mon Feb 11 04:10:48 2008 for Game Accessibility Suite by doxygen 1.5.4