This is a schema registration class.
More...
#include <string>
#include <functional>
|
|
#define | TESSERACT_SCHEMA_REG_PASTE(a, b) a##b |
| |
|
#define | TESSERACT_SCHEMA_REG_MAKE_NAME(a, b) TESSERACT_SCHEMA_REG_PASTE(a, b) |
| |
| #define | TESSERACT_SCHEMA_REGISTER(KEY, SCHEMA_SOURCE) |
| | Macro to register either a file‐based schema or a function‐built schema.
|
| |
| #define | TESSERACT_SCHEMA_REGISTER_DERIVED_TYPE(BASE_TYPE, DERIVED_TYPE) |
| | Macro to register that a derived type can be used where a base type is expected.
|
| |
This is a schema registration class.
- Author
- Levi Armstrong
- Date
- March 1, 2026
- Copyright
- Copyright (c) 2026, Levi Armstrong
- License
- Software License Agreement (Apache License)
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
◆ TESSERACT_SCHEMA_REGISTER
| #define TESSERACT_SCHEMA_REGISTER |
( |
|
KEY, |
|
|
|
SCHEMA_SOURCE |
|
) |
| |
Value: namespace \
{ \
static const int TESSERACT_SCHEMA_REG_MAKE_NAME(schema_reg_, __COUNTER__) = []() -> int { \
using namespace tesseract::common; \
registerSchema(#KEY, SCHEMA_SOURCE); \
return 0; \
}(); \
}
Macro to register either a file‐based schema or a function‐built schema.
◆ TESSERACT_SCHEMA_REGISTER_DERIVED_TYPE
| #define TESSERACT_SCHEMA_REGISTER_DERIVED_TYPE |
( |
|
BASE_TYPE, |
|
|
|
DERIVED_TYPE |
|
) |
| |
Value: namespace \
{ \
static const int TESSERACT_SCHEMA_REG_MAKE_NAME(derived_type_reg_, __COUNTER__) = []() -> int { \
using namespace tesseract::common; \
registerSchemaDerivedType(#BASE_TYPE, #DERIVED_TYPE); \
return 0; \
}(); \
}
Macro to register that a derived type can be used where a base type is expected.
- Parameters
-
| BASE_TYPE | The base type name |
| DERIVED_TYPE | The derived type name |
Example usage:
tesseract::planning::JointPositionConstraint)
#define TESSERACT_SCHEMA_REGISTER_DERIVED_TYPE(BASE_TYPE, DERIVED_TYPE)
Macro to register that a derived type can be used where a base type is expected.
Definition schema_registration.h:85
◆ registerSchema() [1/2]
| void tesseract::common::registerSchema |
( |
const std::string & |
key, |
|
|
const std::string & |
path |
|
) |
| |
Register a schema from a file path.
- Parameters
-
| key | Unique identifier for this schema. |
| path | Path to a .yaml schema file. |
◆ registerSchema() [2/2]
| void tesseract::common::registerSchema |
( |
const std::string & |
key, |
|
|
const std::function< PropertyTree()> & |
fn |
|
) |
| |
Register a schema from a function.
- Parameters
-
| key | Unique identifier for this schema. |
| fn | Function that returns a PropertyTree schema. |
◆ registerSchemaDerivedType()
| void tesseract::common::registerSchemaDerivedType |
( |
const std::string & |
base_type, |
|
|
const std::string & |
derived_type |
|
) |
| |
Register that a derived type schema can be used where a base type is expected.
- Parameters
-
| base_type | The base type name |
| derived_type | The derived type name |