Tesseract 0.28.4
Loading...
Searching...
No Matches
property_tree.cpp File Reference

This is a property tree class. More...

#include <tesseract/common/property_tree.h>
#include <tesseract/common/schema_registry.h>
#include <tesseract/common/yaml_extensions.h>
#include <Eigen/Geometry>
#include <memory>
#include <mutex>
#include <ostream>
#include <regex>
#include <set>

Namespaces

namespace  tesseract::common
 Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all.
 

Functions

std::string tesseract::common::property_type::createList (std::string_view type, std::size_t length=0)
 A utility for constructing the vector<type>
 
std::string tesseract::common::property_type::createMap (std::string_view key, std::string_view type)
 A utility for constructing the map<key, type>
 
std::string tesseract::common::property_type::createMap (std::string_view type)
 A utility for constructing the map<std::string, type>
 
std::ostream & tesseract::common::operator<< (std::ostream &os, const PropertyTree &tree)
 
PropertyTree tesseract::common::makePluginInfoContainerSchema (std::string_view factory_base_type)
 Build a PluginInfoContainer schema for the given factory base type.
 
std::optional< std::pair< std::string, std::size_t > > tesseract::common::isSequenceType (std::string_view type)
 Check if type is a sequence.
 
std::optional< std::pair< std::string, std::string > > tesseract::common::isMapType (std::string_view type)
 Check if type is a map.
 
void tesseract::common::validateRequired (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure 'required' attribute is present and non-null.
 
void tesseract::common::validateEnum (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: enforce that node's value is in 'enum' list.
 
void tesseract::common::validateStringLength (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: enforce minimum_length and maximum_length constraints on strings.
 
void tesseract::common::validateMap (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure node value is of type YAML::NodeType::Map.
 
void tesseract::common::validateSequence (const PropertyTree &node, std::size_t length, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure node value is of type YAML::NodeType::Sequence.
 
void tesseract::common::validateContainer (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: ensure property is a container of child properties. The property should have children and the value should be null.
 
void tesseract::common::validateCustomType (const PropertyTree &node, const std::string &path, std::vector< std::string > &errors)
 Validator: Retrieve schema for the custom type and run its validators.
 
void tesseract::common::validatePluginInfo (const PropertyTree &node, const std::string &base_type, const std::string &path, std::vector< std::string > &errors)
 Validator: Validate a plugin info structure (class + config) for derived types.
 

Detailed Description

This is a property tree class.

Author
Levi Armstrong
Date
March 1, 2026
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.

Function Documentation

◆ createList()

std::string tesseract::common::property_type::createList ( std::string_view  type,
std::size_t  length = 0 
)

A utility for constructing the vector<type>

Parameters
typeThe type assoicated with the list
lengthThe length if fixed size
Returns
The string representation of the vector<type>, aka. type[] and type[length] for fixed size

◆ createMap() [1/2]

std::string tesseract::common::property_type::createMap ( std::string_view  key,
std::string_view  type 
)

A utility for constructing the map<key, type>

Parameters
typeThe value type assoicated with the map
Returns
The string representation of the map<key, type>, aka. {string, string} or {string[2], string}

◆ createMap() [2/2]

std::string tesseract::common::property_type::createMap ( std::string_view  type)

A utility for constructing the map<std::string, type>

Parameters
typeThe value type assoicated with the map
Returns
The string representation of the map<std::string, type>, aka. {string,string}