Lines Matching full:std
48 Error(std::string msg, Type type) : msg_(std::move(msg)), type_(type) {} in Error()
53 std::string GetMessage() const in GetMessage()
64 std::string msg_;
72 std::optional<Error> SetAttribute(const std::string_view &attribute) in SetAttribute()
84 void RemoveAttribute(const std::string &attribute) in RemoveAttribute()
91 bool GetAttribute(const std::string &attribute) const in GetAttribute()
96 …std::optional<Error> SetAttributeValue(const std::string_view &attribute, const std::string_view &… in SetAttributeValue()
108 std::vector<std::string> GetAttributeValues(const std::string &attribute) const in GetAttributeValues()
118 std::optional<std::string> GetAttributeValue(const std::string &attribute) const in GetAttributeValue()
128 const std::unordered_set<std::string> &GetBoolAttributes() const in GetBoolAttributes()
133 const std::unordered_map<std::string, std::vector<std::string>> &GetAttributes() const in GetAttributes()
138 virtual std::optional<Error> ValidateData() in ValidateData()
148 virtual std::optional<Error> Validate(const std::string_view &attribute) const = 0;
150 virtual std::optional<Error> Validate(const std::string_view &attribute,
151 const std::string_view &value) const = 0;
153 …virtual std::optional<Error> StoreValue(const std::string_view &attribute, const std::string_view … in StoreValue()
155 std::string key(attribute); in StoreValue()
158 std::tie(it, std::ignore) = attributes_.try_emplace(key); in StoreValue()
166 virtual std::optional<Error> Store(const std::string_view &attribute) in Store()
173 virtual void SetFlags(const std::string_view &attribute) = 0;
175 virtual void SetFlags(const std::string_view &attribute, const std::string_view &value) = 0;
177 virtual void RemoveFlags(const std::string_view &attribute) = 0;
179 virtual void RemoveFlags(const std::string_view &attribute, const std::string_view &value) = 0;
181 bool HasAttribute(const std::string_view &attribute) const in HasAttribute()
183 std::string key(attribute); in HasAttribute()
187 std::optional<Error> ValidateSize(const std::string_view &value) const;
190 std::unordered_set<std::string> set_attributes_;
191 std::unordered_map<std::string, std::vector<std::string>> attributes_;
196 const std::vector<AnnotationData> &GetAnnotations() const in GetAnnotations()
201 void SetAnnotations(std::vector<AnnotationData> &&annotations) in SetAnnotations()
203 annotations_ = std::forward<std::vector<AnnotationData>>(annotations); in SetAnnotations()
206 void AddAnnotations(const std::vector<AnnotationData> &annotations) in AddAnnotations()
211 void EnumerateAnnotations(const std::function<void(AnnotationData&)> &callback) in EnumerateAnnotations()
218 …void DeleteAnnotationElementByName(std::string_view annotation_name, std::string_view annotation_e… in DeleteAnnotationElementByName()
220 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in DeleteAnnotationElementByName()
229 void DeleteAnnotationByName(const std::string_view &annotation_name) in DeleteAnnotationByName()
231 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in DeleteAnnotationByName()
240 …void AddAnnotationElementByName(const std::string_view &annotation_name, AnnotationElement &&eleme… in AddAnnotationElementByName()
242 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in AddAnnotationElementByName()
247 annotation_iter->AddElement(std::move(element)); in AddAnnotationElementByName()
254 … annotations_[anno_idx].SetOrAddElementByIndex(ele_idx, std::forward<AnnotationElement>(element)); in SetOrAddAnnotationElementByIndex()
257 std::optional<Error> ValidateData() override;
260 std::optional<Error> Store(const std::string_view &attribute) override;
262 …std::optional<Error> StoreValue(const std::string_view &attribute, const std::string_view &value) …
264 … virtual bool IsAnnotationRecordAttribute([[maybe_unused]] const std::string_view &attribute) const in IsAnnotationRecordAttribute()
269 virtual bool IsAnnotationIdAttribute([[maybe_unused]] const std::string_view &attribute) const in IsAnnotationIdAttribute()
274 …virtual bool IsAnnotationElementTypeAttribute([[maybe_unused]] const std::string_view &attribute) … in IsAnnotationElementTypeAttribute()
280 [[maybe_unused]] const std::string_view &attribute) const in IsAnnotationElementArrayComponentTypeAttribute()
285 …virtual bool IsAnnotationElementNameAttribute([[maybe_unused]] const std::string_view &attribute) … in IsAnnotationElementNameAttribute()
290 …virtual bool IsAnnotationElementValueAttribute([[maybe_unused]] const std::string_view &attribute)… in IsAnnotationElementValueAttribute()
298 void Initialize(const std::string_view &name) in Initialize()
324 std::optional<Error> AddValue(
325 const std::string_view &value,
326 … const std::unordered_map<std::string, std::unique_ptr<AnnotationData>> &annotation_id_map);
332 … std::make_unique<ArrayValue>(component_type_.value(), std::move(values_))); in CreateAnnotationElement()
335 return AnnotationElement(name_, std::make_unique<ScalarValue>(values_.front())); in CreateAnnotationElement()
377 std::string name_;
378 std::optional<Value::Type> type_;
379 std::optional<Value::Type> component_type_;
380 std::vector<ScalarValue> values_;
385 void Initialize(const std::string_view &name) in Initialize()
399 void SetId(const std::string_view &id) in SetId()
404 std::string GetId() const in GetId()
412 elements_.push_back(std::forward<AnnotationElement>(element)); in AddElement()
415 std::unique_ptr<AnnotationData> CreateAnnotationData() in CreateAnnotationData()
417 return std::make_unique<AnnotationData>(name_, std::move(elements_)); in CreateAnnotationData()
420 void AddAnnnotationDataToVector(std::vector<AnnotationData> *annotations) in AddAnnnotationDataToVector()
422 annotations->emplace_back(name_, std::move(elements_)); in AddAnnnotationDataToVector()
436 std::string name_;
437 std::optional<std::string> id_;
438 std::vector<AnnotationElement> elements_;
442 std::optional<Metadata::Error> MeetExpRecordAttribute(const std::string_view &attribute,
443 const std::string_view &value);
444 …std::optional<Metadata::Error> MeetExpIdAttribute(const std::string_view &attribute, const std::st…
445 std::optional<Metadata::Error> MeetExpElementNameAttribute(const std::string_view &attribute,
446 const std::string_view &value);
447 std::optional<Metadata::Error> MeetExpElementTypeAttribute(const std::string_view &attribute,
448 const std::string_view &value);
449 …std::optional<Metadata::Error> MeetExpElementArrayComponentTypeAttribute(const std::string_view &a…
450 … const std::string_view &value);
451 std::optional<Metadata::Error> MeetExpElementValueAttribute(const std::string_view &attribute,
452 const std::string_view &value);
454 void InitializeAnnotationBuilder(const std::string_view &name) in InitializeAnnotationBuilder()
485 void InitializeAnnotationElementBuilder(const std::string_view &name) in InitializeAnnotationElementBuilder()
511 std::vector<AnnotationData> annotations_;
512 std::unordered_map<std::string, std::unique_ptr<AnnotationData>> id_map_;
540 virtual std::string GetBase() const;
542 virtual std::vector<std::string> GetInterfaces() const;
553 std::optional<Error> Validate(const std::string_view &attribute) const override;
555 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
557 void SetFlags(const std::string_view &attribute) override;
559 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
561 void RemoveFlags(const std::string_view &attribute) override;
563 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
583 std::optional<ScalarValue> GetValue() const in GetValue()
589 …std::optional<Error> StoreValue(const std::string_view &attribute, const std::string_view &value) …
591 std::optional<Error> Validate(const std::string_view &attribute) const override;
593 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
595 void SetFlags(const std::string_view &attribute) override;
597 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
599 void RemoveFlags(const std::string_view &attribute) override;
601 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
603 virtual bool IsValueAttribute(const std::string_view &attribute) in IsValueAttribute()
610 std::optional<ScalarValue> value_;
620 std::optional<Error> Validate(const std::string_view &attribute) const override;
622 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
624 void SetFlags(const std::string_view &attribute) override;
626 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
628 void RemoveFlags(const std::string_view &attribute) override;
630 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
635 std::optional<Error> Validate(const std::string_view &attribute) const override;
637 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
639 void SetFlags(const std::string_view &attribute) override;
641 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
643 void RemoveFlags(const std::string_view &attribute) override;
645 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;