Go to the documentation of this file.
26 #ifndef TESSERACT_COMMON_PROFILE_DICTIONARY_H
27 #define TESSERACT_COMMON_PROFILE_DICTIONARY_H
31 #include <unordered_map>
33 #include <shared_mutex>
49 using Ptr = std::shared_ptr<ProfileDictionary>;
50 using ConstPtr = std::shared_ptr<const ProfileDictionary>;
68 const std::vector<std::
string>& profile_names,
79 bool hasProfile(std::
size_t key, const std::
string& ns, const std::
string& profile_name) const;
98 template <typename ProfileType>
99 std::shared_ptr<const ProfileType>
getProfile(const std::
string& ns,
100 const std::
string& profile_name,
101 std::shared_ptr<const ProfileType> default_profile =
nullptr)
const
103 if (
hasProfile(ProfileType::getStaticKey(), ns, profile_name))
104 return std::static_pointer_cast<const ProfileType>(
getProfile(ProfileType::getStaticKey(), ns, profile_name));
106 return default_profile;
115 void removeProfile(std::size_t key,
const std::string& ns,
const std::string& profile_name);
138 std::unordered_map<std::string, Profile::ConstPtr>
getProfileEntry(std::size_t key,
const std::string& ns)
const;
144 std::unordered_map<std::string, std::unordered_map<std::size_t, std::unordered_map<std::string, Profile::ConstPtr>>>
152 std::unordered_map<std::string, std::unordered_map<std::size_t, std::unordered_map<std::string, Profile::ConstPtr>>>
158 template <
class Archive>
159 void serialize(Archive& ar,
const unsigned int version);
169 #endif // TESSERACT_COMMON_PROFILE_DICTIONARY_H
This is a profile base class.
Profile::ConstPtr getProfile(std::size_t key, const std::string &ns, const std::string &profile_name) const
Get a profile by name.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
void removeProfile(std::size_t key, const std::string &ns, const std::string &profile_name)
Remove a profile.
void removeProfileEntry(std::size_t key, const std::string &ns)
Remove a profile entry.
std::unordered_map< std::string, std::unordered_map< std::size_t, std::unordered_map< std::string, Profile::ConstPtr > > > getAllProfileEntries() const
Get all profile entries.
~ProfileDictionary()=default
std::shared_ptr< const ProfileDictionary > ConstPtr
ProfileDictionary()=default
friend class boost::serialization::access
bool hasProfileEntry(std::size_t key, const std::string &ns) const
Check if a profile entry exists.
std::unordered_map< std::string, std::unordered_map< std::size_t, std::unordered_map< std::string, Profile::ConstPtr > > > profiles_
void clear()
Clear the dictionary.
This class is used to store profiles used by various tasks.
ProfileDictionary & operator=(const ProfileDictionary &)
std::shared_ptr< ProfileDictionary > Ptr
#define TESSERACT_COMMON_IGNORE_WARNINGS_POP
void serialize(Archive &ar, const unsigned int version)
bool hasProfile(std::size_t key, const std::string &ns, const std::string &profile_name) const
Check if a profile exists.
std::unordered_map< std::string, Profile::ConstPtr > getProfileEntry(std::size_t key, const std::string &ns) const
Get a profile entry.
void addProfile(const std::string &ns, const std::string &profile_name, const Profile::ConstPtr &profile)
Add a profile.
tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40