The Blueprint class - Responsible for producing contexts and instances of data used by UtilityReasoner.
More...
#include <Blueprint.hh>
|
| Blueprint (std::string name, std::function< std::vector< ContexType >(const DataType &)> contextProducer, std::function< std::unique_ptr< InstanceType >(const ContexType &)> instanceProducer) |
| Blueprint - Contructor. More...
|
|
| Blueprint (const Blueprint &other)=default |
|
| Blueprint (Blueprint &&other)=default |
|
Blueprint & | operator= (const Blueprint &other)=delete |
|
Blueprint & | operator= (Blueprint &&other)=delete |
|
std::vector< ContexType > | ProduceContexts (const DataType &data) const |
| ProduceContexts - Uses ContextProducerDelegate provided in the constructor to produce a collection of ContextTypes. More...
|
|
std::unique_ptr< InstanceType > | ProduceInstance (const ContexType &context) const |
| ProduceInstance - Uses InstanceProducerDelegate provided in constructor to produce instance of InstanceType based on given ContextType. More...
|
|
std::string | GetName () const |
| GetName. More...
|
|
template<typename InstanceType, typename ContexType = EntityBlackboardPair, typename DataType = class AIEntity>
class grail::utility::Blueprint< InstanceType, ContexType, DataType >
The Blueprint class - Responsible for producing contexts and instances of data used by UtilityReasoner.
- Template Parameters
-
InstanceType | - Type of objects which can be produced from Blueprints and selected by Selector. By default - Behavior. |
ContextType | - Type of objects which can be paired with Blueprints of InstanceType and evaluated by Selector. Data contained in ContextType object must contain all information needed to produce an instance from Blueprint By default - ValueTuple(AIEntity, Blackboard). |
DataType | - Type of objects from which ContextType can be generated. Be default - AIEntity. |
◆ Blueprint()
template<typename InstanceType , typename ContexType = EntityBlackboardPair, typename DataType = class AIEntity>
grail::utility::Blueprint< InstanceType, ContexType, DataType >::Blueprint |
( |
std::string |
name, |
|
|
std::function< std::vector< ContexType >(const DataType &)> |
contextProducer, |
|
|
std::function< std::unique_ptr< InstanceType >(const ContexType &)> |
instanceProducer |
|
) |
| |
|
inline |
Blueprint - Contructor.
- Parameters
-
name | - Name of this blueprint. |
contextProducer | - Callable responsible for producing a collection of ContextTypes. |
instanceProducer | - Callable responsible for producing an instance of InstanceType based on the provided ContextType. |
◆ GetName()
template<typename InstanceType , typename ContexType = EntityBlackboardPair, typename DataType = class AIEntity>
GetName.
- Returns
- Name of this blueprint and instances it produces.
◆ ProduceContexts()
template<typename InstanceType , typename ContexType = EntityBlackboardPair, typename DataType = class AIEntity>
std::vector<ContexType> grail::utility::Blueprint< InstanceType, ContexType, DataType >::ProduceContexts |
( |
const DataType & |
data | ) |
const |
|
inline |
ProduceContexts - Uses ContextProducerDelegate provided in the constructor to produce a collection of ContextTypes.
- Parameters
-
data | - Object containing data necessary to produce contexts. |
- Returns
- Collection of produces ContextTypes.
◆ ProduceInstance()
template<typename InstanceType , typename ContexType = EntityBlackboardPair, typename DataType = class AIEntity>
std::unique_ptr<InstanceType> grail::utility::Blueprint< InstanceType, ContexType, DataType >::ProduceInstance |
( |
const ContexType & |
context | ) |
const |
|
inline |
ProduceInstance - Uses InstanceProducerDelegate provided in constructor to produce instance of InstanceType based on given ContextType.
- Parameters
-
context | - Context object containing data necessary to produce an instance. |
- Returns
- New instance of InstanceType.
The documentation for this class was generated from the following file: