Game Develop Core: gd::PlatformExtension Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
gd::PlatformExtension Class Reference
Platform Definition ( Classes defining the common concepts used by all platforms )

Base class for implementing platform's extensions. More...

`#include <PlatformExtension.h>`

## Public Member Functions

void | SetExtensionInformation (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &author_, const std::string &license_)
| Must be called to declare the main information about the extension.
gd::InstructionMetadata & | AddCondition (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &sentence_, const std::string &group_, const std::string &icon_, const std::string &smallicon_)
| Declare a new condition as being part of the extension. More...
gd::InstructionMetadata & | AddAction (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &sentence_, const std::string &group_, const std::string &icon_, const std::string &smallicon_)
| Declare a new action as being part of the extension. More...
gd::ExpressionMetadata & | AddExpression (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &group_, const std::string &smallicon_)
| Declare a new expression as being part of the extension. More...
gd::StrExpressionMetadata & | AddStrExpression (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &group_, const std::string &smallicon_)
| Declare a new string expression as being part of the extension. More...
gd::ObjectMetadata & | AddObject (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &icon24x24_, CreateFunPtr createFunPtrP, DestroyFunPtr destroyFunPtrP)
| Declare a new object as being part of the extension. More...
gd::AutomatismMetadata & | AddAutomatism (const std::string &name_, const std::string &fullname_, const std::string &defaultName_, const std::string &description_, const std::string &group_, const std::string &icon24x24_, const std::string &className_, boost::shared_ptr< gd::Automatism > instance, boost::shared_ptr< gd::AutomatismsSharedData > sharedDatasInstance)
| Declare a new automatism as being part of the extension. More...
gd::EventMetadata & | AddEvent (const std::string &name_, const std::string &fullname_, const std::string &description_, const std::string &group_, const std::string &smallicon_, boost::shared_ptr< gd::BaseEvent > instance)
| Declare a new event as being part of the extension. More...
const std::string & | GetFullName () const
| Return the name extension user friendly name.
const std::string & | GetName () const
| Return the name of the extension.
const std::string & | GetDescription () const
| Return a description of the extension.
const std::string & | GetAuthor () const
| Return the name of the extension developer.
const std::string & | GetLicense () const
| Return the name of extension license.
bool | IsBuiltin () const
| Return true if the extension is a standard extension that cannot be deactivated.
std::string | GetNameSpace ()
| Get the namespace of the extension. More...
std::vector< std::string > | GetExtensionObjectsTypes () const
| Return a vector containing all the object types provided by the extension.
std::vector< std::string > | GetAutomatismsTypes () const
| Return a vector containing all the automatism types provided by the extension.
CreateFunPtr | GetObjectCreationFunctionPtr (std::string objectType) const
| Return a function to create the object if the type is handled by the extension.
DestroyFunPtr | GetDestroyObjectFunction (std::string objectType) const
| Make sure that the object from an extension is deleted by the same extension.
boost::shared_ptr< gd::BaseEvent > | CreateEvent (std::string eventType) const
| Create a custom event. More...
gd::Automatism * | CreateAutomatism (std::string automatismType) const
| Create an automatism. More...
boost::shared_ptr < gd::AutomatismsSharedData > | CreateAutomatismSharedDatas (std::string automatismType) const
| Create shared data for an automatism. More...
ObjectMetadata & | GetObjectMetadata (const std::string &objectType)
| Return a reference to the ObjectMetadata object associated to objectType.
AutomatismMetadata & | GetAutomatismMetadata (const std::string &automatismType)
| Return a reference to the AutomatismMetadata object associated to automatismType.
std::map< std::string, gd::EventMetadata > & | GetAllEvents ()
| Return a map containing all the events provided by the extension.
std::map< std::string, gd::AutomatismMetadata > & | GetAllAutomatisms ()
| Return a map containing all the automatisms provided by the extension.
std::map< std::string, gd::InstructionMetadata > & | GetAllActions ()
| Return a reference to a map containing the names of the actions (in the first members) and the metadata associated with (in the second members).
std::map< std::string, gd::InstructionMetadata > & | GetAllConditions ()
std::map< std::string, gd::ExpressionMetadata > & | GetAllExpressions ()
std::map< std::string, gd::StrExpressionMetadata > & | GetAllStrExpressions ()
std::map< std::string, gd::InstructionMetadata > & | GetAllActionsForObject (std::string objectType)
| Return a reference to a map containing the names of the actions, related to the object type, and the metadata associated with.
std::map< std::string, gd::InstructionMetadata > & | GetAllConditionsForObject (std::string objectType)
std::map< std::string, gd::ExpressionMetadata > & | GetAllExpressionsForObject (std::string objectType)
std::map< std::string, gd::StrExpressionMetadata > & | GetAllStrExpressionsForObject (std::string objectType)
std::map< std::string, gd::InstructionMetadata > & | GetAllActionsForAutomatism (std::string autoType)
std::map< std::string, gd::InstructionMetadata > & | GetAllConditionsForAutomatism (std::string autoType)
std::map< std::string, gd::ExpressionMetadata > & | GetAllExpressionsForAutomatism (std::string autoType)
std::map< std::string, gd::StrExpressionMetadata > & | GetAllStrExpressionsForAutomatism (std::string autoType)
virtual void | ExposeConditionsResources (Instruction &condition, gd::ArbitraryResourceWorker &worker)
virtual void | ExposeActionsResources (Instruction &action, gd::ArbitraryResourceWorker &worker)
void | CloneExtension (const std::string &platformName, const std::string &extensionName, bool stripFunctionsNameAndCodeGeneration=true)
| Clone the extension of another platform. More...
void | StripUnimplementedInstructionsAndExpressions ()
| Delete all instructions having no functions name or custom code generator.

## Static Public Member Functions

static std::vector< std::string > | GetBuiltinExtensionsNames ()
| Return the name of all the extensions which are considered provided by platforms.

## Public Attributes

CompilationInfo | compilationInfo

## Detailed Description

Base class for implementing platform's extensions.

## Member Function Documentation

gd::InstructionMetadata & gd::PlatformExtension::AddAction | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | sentence_,
|  | const std::string & | group_,
|  | const std::string & | icon_,
|  | const std::string & | smallicon_
| ) |  |

Declare a new action as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

gd::AutomatismMetadata & gd::PlatformExtension::AddAutomatism | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | defaultName_,
|  | const std::string & | description_,
|  | const std::string & | group_,
|  | const std::string & | icon24x24_,
|  | const std::string & | className_,
|  | boost::shared_ptr< gd::Automatism > | instance,
|  | boost::shared_ptr< gd::AutomatismsSharedData > | sharedDatasInstance
| ) |  |

Declare a new automatism as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

Parameters

  name | The name of the automatism
  fullname | The user friendly name of the automatism
  description | The user friendly description of the automatism
  icon | The 24x24 icon of the automatism: res/icons_[SkinName]/[iconName]24.png will be first tried, and then if it does not exists, it is assumed that the icon name is the filename that must be used to open the icon.
  instance | An instance of the automatism that will be used to create the automatism
  sharedDatasInstance | Optional instance of the data shared by the automatisms having the same name.

gd::InstructionMetadata & gd::PlatformExtension::AddCondition | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | sentence_,
|  | const std::string & | group_,
|  | const std::string & | icon_,
|  | const std::string & | smallicon_
| ) |  |

Declare a new condition as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

gd::EventMetadata & gd::PlatformExtension::AddEvent | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | group_,
|  | const std::string & | smallicon_,
|  | boost::shared_ptr< gd::BaseEvent > | instance
| ) |  |

Declare a new event as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

gd::ExpressionMetadata & gd::PlatformExtension::AddExpression | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | group_,
|  | const std::string & | smallicon_
| ) |  |

Declare a new expression as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

gd::ObjectMetadata & gd::PlatformExtension::AddObject | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | icon24x24_,
|  | CreateFunPtr | createFunPtrP,
|  | DestroyFunPtr | destroyFunPtrP
| ) |  |

Declare a new object as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

Parameters

  name | The name of the object
  fullname | The user friendly name of the object
  description | The user friendly description of the object
  icon | The 24x24 icon of the object: res/icons_[SkinName]/[iconName]24.png will be first tried, and then if it does not exists, the full entered name will be tried.
  createFunPtr | The name of the function that create the object
  destroyFunPtr | The name of the function that destroy the object

Example of the create/destroy function:

void DestroyMyObject(gd::Object * object)
{
delete object;
}
gd::Object * CreateMyObject(std::string name)
{
return new MyObject(name);
}

gd::StrExpressionMetadata & gd::PlatformExtension::AddStrExpression | ( | const std::string & | name_,
|  | const std::string & | fullname_,
|  | const std::string & | description_,
|  | const std::string & | group_,
|  | const std::string & | smallicon_
| ) |  |

Declare a new string expression as being part of the extension.

Note
  This method does nothing when used for GD C++ runtime.

void gd::PlatformExtension::CloneExtension | ( | const std::string & | platformName,
|  | const std::string & | extensionName,
|  | bool | stripFunctionsNameAndCodeGeneration = `true`
| ) |  |

Clone the extension of another platform.

This can be used when you want a platform to conform to another.
It is still possible to make some changes after the cloning by using getter methods.
See also gd::PlatformExtension::StripUnimplementedInstructionsAndExpressions.

Parameters

  platformName | The name of the platform in which the source extension must be searched for.
  extensionName | The name of the source extension to be copied.
  stripFunctionsNameAndCodeGeneration | If set to true, all functions names and code generator of all instructions/expression/events will be removed.

Automatism * gd::PlatformExtension::CreateAutomatism | ( | std::string | automatismType) |  | const

Create an automatism.

Return NULL if automatismType is not provided by the extension.

boost::shared_ptr< gd::AutomatismsSharedData > gd::PlatformExtension::CreateAutomatismSharedDatas | ( | std::string | automatismType) |  | const

Create shared data for an automatism.

Return NULL if automatismType is not provided by the extension.

gd::BaseEventSPtr gd::PlatformExtension::CreateEvent | ( | std::string | eventType) |  | const

Create a custom event.

Return an empty pointer if eventType is not provided by the extension.

virtual void gd::PlatformExtension::ExposeActionsResources | ( | Instruction & | action,
|  | gd::ArbitraryResourceWorker & | worker
| ) |  |

inlinevirtual

Called ( e.g. during compilation ) so as to inventory resources used by actions and update their filename

See Also
  ArbitraryResourceWorker

virtual void gd::PlatformExtension::ExposeConditionsResources | ( | Instruction & | condition,
|  | gd::ArbitraryResourceWorker & | worker
| ) |  |

inlinevirtual

Called ( e.g. during compilation ) so as to inventory resources used by conditions and update their filename

See Also
  gd::PlatformExtension::ExposeActionsResources

std::map< std::string, gd::InstructionMetadata > & gd::PlatformExtension::GetAllActionsForAutomatism | ( | std::string | autoType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditions | ( | ) |  |

See Also
  gd::PlatformExtension::GetAllActions

std::map< std::string, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditionsForAutomatism | ( | std::string | autoType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::InstructionMetadata > & gd::PlatformExtension::GetAllConditionsForObject | ( | std::string | objectType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressions | ( | ) |  |

See Also
  gd::PlatformExtension::GetAllActions

std::map< std::string, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressionsForAutomatism | ( | std::string | autoType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::ExpressionMetadata > & gd::PlatformExtension::GetAllExpressionsForObject | ( | std::string | objectType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::StrExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressions | ( | ) |  |

See Also
  gd::PlatformExtension::GetAllActions

std::map< std::string, gd::StrExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressionsForAutomatism | ( | std::string | autoType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::map< std::string, gd::StrExpressionMetadata > & gd::PlatformExtension::GetAllStrExpressionsForObject | ( | std::string | objectType) |  |

See Also
  gd::PlatformExtension::GetAllActionsForObject

std::string gd::PlatformExtension::GetNameSpace | ( | ) |  |

inline

Get the namespace of the extension.

Note
  The namespace is simply the name of the extension concatenated with "::" at the end.

The documentation for this class was generated from the following files:

- PlatformExtension.h
- PlatformExtension.cpp