Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_CodeFragment Class Reference

Base class to provide code fragment support for CPLAT. A code fragment can be stored in a MacOS shared lib, or a Windows dll, loaded and executed.

List of all members.

Getters

CP_String GetName () const
CP_OSCodeFragment GetOSFragment () const
void * GetFunction (const CP_String &inFunctionName) const
static void * GetCGFunction (CFStringRef inFunctionName)
static void * GetCarbonFunction (CFStringRef inFunctionName)
static void * GetHIObjectFunction (CFStringRef inFunctionName)

Public Member Functions

Constructor / Destructor
 CP_CodeFragment (const CP_String &inFragmentName, CP_E_FragOptions inOptions=kUseExistingFragment)
 Constructor.
 CP_CodeFragment (const CP_FileSystemSpec &inFragmentSpec, CP_E_FragOptions inOptions=kUseExistingFragment)
 CP_CodeFragment (const CP_FileSystemSpec &inFragmentSpec, UInt32 inOffset, UInt32 inBytes, CP_E_FragOptions inOptions=kUseExistingFragment)
 CP_CodeFragment (const CP_String &inFragmentName, const void *inAddress, UInt32 inBytes, CP_E_FragOptions inOptions=kUseExistingFragment)
 ~CP_CodeFragment ()
 Destructor.

Protected Attributes

CP_String fFragmentName
CP_OSCodeFragment fFragment
Ptr fMainAdr


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_CodeFragment::CP_CodeFragment const CP_String inFragmentName,
CP_E_FragOptions  inOptions = kUseExistingFragment
 

Constructor.

Parameters:
inFragmentName Name of the code fragment to load.
inOptions Flags to control how the OS will load the code fragment. They can be one of the following:
  • kUseExistingFragment (MacOS only)
  • kLoadNewFragment (any OS)
Exceptions:
none 

CP_CodeFragment::CP_CodeFragment const CP_FileSystemSpec inFragmentSpec,
CP_E_FragOptions  inOptions = kUseExistingFragment
 

Constructor.

Parameters:
inFragmentSpec CP_FileSystemSpec that points to the file that contains the fragment we are after.
inOptions Flags to control how the OS will load the code fragment. They can be one of the following:
  • kUseExistingFragment (MacOS only)
  • kLoadNewFragment (any OS)
Exceptions:
none 

CP_CodeFragment::CP_CodeFragment const CP_FileSystemSpec inFragmentSpec,
UInt32  inOffset,
UInt32  inBytes,
CP_E_FragOptions  inOptions = kUseExistingFragment
 

Constructor.

Parameters:
inFragmentSpec CP_FileSystemSpec that points to the file that contains the fragment we are after.
inOffset Offset within the file to locate the fragment.
inBytes Bytes to load.
inOptions Flags to control how the OS will load the code fragment. They can be one of the following:
  • kUseExistingFragment (MacOS only)
  • kLoadNewFragment (any OS)
Exceptions:
none 

CP_CodeFragment::CP_CodeFragment const CP_String inFragmentName,
const void *  inAddress,
UInt32  inBytes,
CP_E_FragOptions  inOptions = kUseExistingFragment
 

Constructor.

Parameters:
inFragmentName Name of the fragment to load.
inAddress Address in memory to load the fragment from.
inBytes Bytes to load.
inOptions Flags to control how the OS will load the code fragment. They can be one of the following:
  • kUseExistingFragment (MacOS only)
  • kLoadNewFragment (any OS)
Exceptions:
none 

CP_CodeFragment::~CP_CodeFragment  ) 
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_String CP_CodeFragment::GetName  )  const
 

Returns the name of the code fragment.

Exceptions:
none 
Returns:
CP_String The name of the code fragment.

CP_OSCodeFragment CP_CodeFragment::GetOSFragment  )  const
 

Returns the CP_OSCodeFragment which is the underlying OS code fragment.

Exceptions:
none 
Returns:
CP_OSCodeFragment The underlying OS code fragment.

void * CP_CodeFragment::GetFunction const CP_String inFunctionName  )  const
 

Return a pointer to the function from our code fragment. Returns NULL if the function can't be found.

Parameters:
inFunctionName Name of the function to load.
Exceptions:
none 
Returns:
void * const Returns the pointer to the function if it exists, otherwise NULL is returned.

void * CP_CodeFragment::GetCGFunction CFStringRef  inFunctionName  )  [static]
 

Return a function pointer for the passed in function name from the CoreGraphics framework.

Parameters:
inFunctionName Name of the function to load.
Exceptions:
none 
Returns:
void * Returns the pointer to the function if it exists, otherwise NULL is returned.

void * CP_CodeFragment::GetCarbonFunction CFStringRef  inFunctionName  )  [static]
 

Return a function pointer for the passed in function name from the Carbon framework.

Parameters:
inFunctionName Name of the function to load.
Exceptions:
none 
Returns:
void * Returns the pointer to the function if it exists, otherwise NULL is returned.

void * CP_CodeFragment::GetHIObjectFunction CFStringRef  inFunctionName  )  [static]
 

Return a function pointer for the passed in function name from the HIObject framework.

Parameters:
inFunctionName Name of the function to load.
Exceptions:
none 
Returns:
void * Returns the pointer to the function if it exists, otherwise NULL is returned.


Member Data Documentation

CP_String CP_CodeFragment::fFragmentName [protected]
 

CP_OSCodeFragment CP_CodeFragment::fFragment [protected]
 

Name of code fragment we want.

Ptr CP_CodeFragment::fMainAdr [protected]
 

The OS code fragment.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:36 2005 for CPLAT_MacOS by  doxygen 1.4.0