Ember
Loading...
Searching...
No Matches
EmberCore::ParserConfig Class Reference

Configuration for XML parser behavior and element/attribute mappings. More...

#include <ParserConfig.h>

Classes

struct  AdvancedConfig
struct  BlackboardConfig
struct  ClassificationConfig
struct  DocumentConfig
struct  NodeConfig
struct  TreeConfig

Public Types

enum class  ClassificationStrategy { BY_ELEMENT_NAME , BY_ATTRIBUTE , HYBRID }
 Strategy for classifying node types. More...
enum class  UnknownTypeBehavior { ERROR , WARNING , GENERIC_NODE }
 How to handle unknown/unmapped types. More...
enum class  WhitespaceHandling { PRESERVE , TRIM , NORMALIZE }
 Whitespace handling strategy. More...
enum class  NamingConvention { STRICT , BALANCED , LOOSE }
 Naming convention strictness. More...
enum class  SubTreeExpansion { IMMEDIATE , LAZY , MANUAL }
 SubTree expansion strategy. More...

Public Member Functions

 ParserConfig ()
 ~ParserConfig ()=default
DocumentConfigGetDocumentConfig ()
const DocumentConfigGetDocumentConfig () const
TreeConfigGetTreeConfig ()
const TreeConfigGetTreeConfig () const
NodeConfigGetNodeConfig ()
const NodeConfigGetNodeConfig () const
ClassificationConfigGetClassificationConfig ()
const ClassificationConfigGetClassificationConfig () const
BlackboardConfigGetBlackboardConfig ()
const BlackboardConfigGetBlackboardConfig () const
AdvancedConfigGetAdvancedConfig ()
const AdvancedConfigGetAdvancedConfig () const
nlohmann::json ToJson () const
void FromJson (const nlohmann::json &json)
bool Validate (std::vector< String > &errors) const
bool IsControlType (const String &type) const
bool IsDecoratorType (const String &type) const
bool IsActionType (const String &type) const
bool IsConditionType (const String &type) const

Static Public Member Functions

static ParserConfig CreateDefault ()
static ParserConfig CreateGeneric ()

Static Private Member Functions

static nlohmann::json ClassificationStrategyToJson (ClassificationStrategy strategy)
static ClassificationStrategy ClassificationStrategyFromJson (const nlohmann::json &json)
static nlohmann::json UnknownTypeBehaviorToJson (UnknownTypeBehavior behavior)
static UnknownTypeBehavior UnknownTypeBehaviorFromJson (const nlohmann::json &json)
static nlohmann::json WhitespaceHandlingToJson (WhitespaceHandling handling)
static WhitespaceHandling WhitespaceHandlingFromJson (const nlohmann::json &json)
static nlohmann::json SubTreeExpansionToJson (SubTreeExpansion expansion)
static SubTreeExpansion SubTreeExpansionFromJson (const nlohmann::json &json)
static nlohmann::json NamingConventionToJson (NamingConvention convention)
static NamingConvention NamingConventionFromJson (const nlohmann::json &json)

Private Attributes

DocumentConfig document_config_
TreeConfig tree_config_
NodeConfig node_config_
ClassificationConfig classification_config_
BlackboardConfig blackboard_config_
AdvancedConfig advanced_config_

Detailed Description

Configuration for XML parser behavior and element/attribute mappings.

This class defines how the parser interprets XML elements and attributes, allowing the parser to work with different behavior tree XML formats.

Definition at line 17 of file ParserConfig.h.

Member Enumeration Documentation

◆ ClassificationStrategy

Strategy for classifying node types.

Enumerator
BY_ELEMENT_NAME 
BY_ATTRIBUTE 
HYBRID 

Definition at line 22 of file ParserConfig.h.

◆ NamingConvention

Naming convention strictness.

Enumerator
STRICT 
BALANCED 
LOOSE 

Definition at line 49 of file ParserConfig.h.

◆ SubTreeExpansion

SubTree expansion strategy.

Enumerator
IMMEDIATE 
LAZY 
MANUAL 

Definition at line 58 of file ParserConfig.h.

◆ UnknownTypeBehavior

How to handle unknown/unmapped types.

Enumerator
ERROR 
WARNING 
GENERIC_NODE 

Definition at line 31 of file ParserConfig.h.

◆ WhitespaceHandling

Whitespace handling strategy.

Enumerator
PRESERVE 
TRIM 
NORMALIZE 

Definition at line 40 of file ParserConfig.h.

Constructor & Destructor Documentation

◆ ParserConfig()

EmberCore::ParserConfig::ParserConfig ( )

Definition at line 7 of file ParserConfig.cpp.

◆ ~ParserConfig()

EmberCore::ParserConfig::~ParserConfig ( )
default

Member Function Documentation

◆ ClassificationStrategyFromJson()

ParserConfig::ClassificationStrategy EmberCore::ParserConfig::ClassificationStrategyFromJson ( const nlohmann::json & json)
staticprivate

Definition at line 346 of file ParserConfig.cpp.

◆ ClassificationStrategyToJson()

nlohmann::json EmberCore::ParserConfig::ClassificationStrategyToJson ( ClassificationStrategy strategy)
staticprivate

Definition at line 333 of file ParserConfig.cpp.

◆ CreateDefault()

ParserConfig EmberCore::ParserConfig::CreateDefault ( )
static

Definition at line 314 of file ParserConfig.cpp.

◆ CreateGeneric()

ParserConfig EmberCore::ParserConfig::CreateGeneric ( )
static

Definition at line 320 of file ParserConfig.cpp.

◆ FromJson()

void EmberCore::ParserConfig::FromJson ( const nlohmann::json & json)

Definition at line 87 of file ParserConfig.cpp.

◆ GetAdvancedConfig() [1/2]

AdvancedConfig & EmberCore::ParserConfig::GetAdvancedConfig ( )
inline

Definition at line 157 of file ParserConfig.h.

◆ GetAdvancedConfig() [2/2]

const AdvancedConfig & EmberCore::ParserConfig::GetAdvancedConfig ( ) const
inline

Definition at line 158 of file ParserConfig.h.

◆ GetBlackboardConfig() [1/2]

BlackboardConfig & EmberCore::ParserConfig::GetBlackboardConfig ( )
inline

Definition at line 154 of file ParserConfig.h.

◆ GetBlackboardConfig() [2/2]

const BlackboardConfig & EmberCore::ParserConfig::GetBlackboardConfig ( ) const
inline

Definition at line 155 of file ParserConfig.h.

◆ GetClassificationConfig() [1/2]

ClassificationConfig & EmberCore::ParserConfig::GetClassificationConfig ( )
inline

Definition at line 151 of file ParserConfig.h.

◆ GetClassificationConfig() [2/2]

const ClassificationConfig & EmberCore::ParserConfig::GetClassificationConfig ( ) const
inline

Definition at line 152 of file ParserConfig.h.

◆ GetDocumentConfig() [1/2]

DocumentConfig & EmberCore::ParserConfig::GetDocumentConfig ( )
inline

Definition at line 142 of file ParserConfig.h.

◆ GetDocumentConfig() [2/2]

const DocumentConfig & EmberCore::ParserConfig::GetDocumentConfig ( ) const
inline

Definition at line 143 of file ParserConfig.h.

◆ GetNodeConfig() [1/2]

NodeConfig & EmberCore::ParserConfig::GetNodeConfig ( )
inline

Definition at line 148 of file ParserConfig.h.

◆ GetNodeConfig() [2/2]

const NodeConfig & EmberCore::ParserConfig::GetNodeConfig ( ) const
inline

Definition at line 149 of file ParserConfig.h.

◆ GetTreeConfig() [1/2]

TreeConfig & EmberCore::ParserConfig::GetTreeConfig ( )
inline

Definition at line 145 of file ParserConfig.h.

◆ GetTreeConfig() [2/2]

const TreeConfig & EmberCore::ParserConfig::GetTreeConfig ( ) const
inline

Definition at line 146 of file ParserConfig.h.

◆ IsActionType()

bool EmberCore::ParserConfig::IsActionType ( const String & type) const

Definition at line 297 of file ParserConfig.cpp.

◆ IsConditionType()

bool EmberCore::ParserConfig::IsConditionType ( const String & type) const

Definition at line 306 of file ParserConfig.cpp.

◆ IsControlType()

bool EmberCore::ParserConfig::IsControlType ( const String & type) const

Definition at line 287 of file ParserConfig.cpp.

◆ IsDecoratorType()

bool EmberCore::ParserConfig::IsDecoratorType ( const String & type) const

Definition at line 292 of file ParserConfig.cpp.

◆ NamingConventionFromJson()

ParserConfig::NamingConvention EmberCore::ParserConfig::NamingConventionFromJson ( const nlohmann::json & json)
staticprivate

Definition at line 442 of file ParserConfig.cpp.

◆ NamingConventionToJson()

nlohmann::json EmberCore::ParserConfig::NamingConventionToJson ( NamingConvention convention)
staticprivate

Definition at line 429 of file ParserConfig.cpp.

◆ SubTreeExpansionFromJson()

ParserConfig::SubTreeExpansion EmberCore::ParserConfig::SubTreeExpansionFromJson ( const nlohmann::json & json)
staticprivate

Definition at line 418 of file ParserConfig.cpp.

◆ SubTreeExpansionToJson()

nlohmann::json EmberCore::ParserConfig::SubTreeExpansionToJson ( SubTreeExpansion expansion)
staticprivate

Definition at line 405 of file ParserConfig.cpp.

◆ ToJson()

nlohmann::json EmberCore::ParserConfig::ToJson ( ) const

Definition at line 22 of file ParserConfig.cpp.

◆ UnknownTypeBehaviorFromJson()

ParserConfig::UnknownTypeBehavior EmberCore::ParserConfig::UnknownTypeBehaviorFromJson ( const nlohmann::json & json)
staticprivate

Definition at line 370 of file ParserConfig.cpp.

◆ UnknownTypeBehaviorToJson()

nlohmann::json EmberCore::ParserConfig::UnknownTypeBehaviorToJson ( UnknownTypeBehavior behavior)
staticprivate

Definition at line 357 of file ParserConfig.cpp.

◆ Validate()

bool EmberCore::ParserConfig::Validate ( std::vector< String > & errors) const

Definition at line 230 of file ParserConfig.cpp.

◆ WhitespaceHandlingFromJson()

ParserConfig::WhitespaceHandling EmberCore::ParserConfig::WhitespaceHandlingFromJson ( const nlohmann::json & json)
staticprivate

Definition at line 394 of file ParserConfig.cpp.

◆ WhitespaceHandlingToJson()

nlohmann::json EmberCore::ParserConfig::WhitespaceHandlingToJson ( WhitespaceHandling handling)
staticprivate

Definition at line 381 of file ParserConfig.cpp.

Member Data Documentation

◆ advanced_config_

AdvancedConfig EmberCore::ParserConfig::advanced_config_
private

Definition at line 183 of file ParserConfig.h.

◆ blackboard_config_

BlackboardConfig EmberCore::ParserConfig::blackboard_config_
private

Definition at line 182 of file ParserConfig.h.

◆ classification_config_

ClassificationConfig EmberCore::ParserConfig::classification_config_
private

Definition at line 181 of file ParserConfig.h.

◆ document_config_

DocumentConfig EmberCore::ParserConfig::document_config_
private

Definition at line 178 of file ParserConfig.h.

◆ node_config_

NodeConfig EmberCore::ParserConfig::node_config_
private

Definition at line 180 of file ParserConfig.h.

◆ tree_config_

TreeConfig EmberCore::ParserConfig::tree_config_
private

Definition at line 179 of file ParserConfig.h.


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