13 std::time_t t =
static_cast<std::time_t
>(
creationDate.value());
14 return std::ctime(&t);
20 if (std::time_t result; std::time(&result) ==
static_cast<std::time_t
>(-1)) {
21 STORM_LOG_WARN(
"No creation time is set for UMB index: unable to get the current time.");
31 auto isAllowed = [](
auto ch) {
return (std::isalnum(ch) && !std::isupper(ch)) || ch ==
'_' || ch ==
'-'; };
36 std::stringstream identifier;
37 for (
auto ch :
alias) {
40 }
else if (ch ==
' ') {
43 identifier <<
"0x" << std::setw(2) << std::setfill(
'0') << std::hex << static_cast<int>(ch);
46 return identifier.str();
86 if (createIfMissing) {
123 if (!map.has_value()) {
128 for (
auto const& [name,
annotation] : map.value()) {
135 if (map->contains(
id)) {
Helper class that optionally holds a reference to an object of type T.
#define STORM_LOG_WARN(message)
const std::string DefaultAnnotationAlias
bool appliesToObservations() const
std::vector< storm::SerializedEnum< AppliesToDeclaration > > appliesTo
static std::string getValidIdentifierFromAlias(std::string const &alias)
Takes an alias (which can be an arbitrary string) and converts it to a valid identifier in [0-9a-z_-]...
bool appliesToPlayers() const
bool appliesToChoices() const
bool appliesToStates() const
bool appliesToBranches() const
std::optional< std::string > alias
void setCreationDateToNow()
std::string creationDateAsString() const
std::optional< uint64_t > creationDate
std::optional< std::map< std::string, AnnotationMap > > annotations
storm::OptionalRef< AnnotationMap const > rewards() const
std::optional< std::string > findAPName(std::string const &id) const
Finds a name of the annotation (i.e.
storm::OptionalRef< AnnotationMap > annotation(std::string const &annotationsType, bool createIfMissing=false)
std::optional< std::string > findAnnotationName(std::string const &annotationsType, std::string const &id) const
storm::OptionalRef< AnnotationMap const > aps() const
std::optional< std::string > findRewardName(std::string const &id) const