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 DeleteAnnotationElementByName(std::string_view annotation_name, std::string_view annotation_e… in DeleteAnnotationElementByName()
213 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in DeleteAnnotationElementByName()
222 void DeleteAnnotationByName(const std::string_view &annotation_name) in DeleteAnnotationByName()
224 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in DeleteAnnotationByName()
233 …void AddAnnotationElementByName(const std::string_view &annotation_name, AnnotationElement &&eleme… in AddAnnotationElementByName()
235 auto annotation_iter = std::find_if(annotations_.begin(), annotations_.end(), in AddAnnotationElementByName()
240 annotation_iter->AddElement(std::move(element)); in AddAnnotationElementByName()
247 … annotations_[anno_idx].SetOrAddElementByIndex(ele_idx, std::forward<AnnotationElement>(element)); in SetOrAddAnnotationElementByIndex()
250 std::optional<Error> ValidateData() override;
253 std::optional<Error> Store(const std::string_view &attribute) override;
255 …std::optional<Error> StoreValue(const std::string_view &attribute, const std::string_view &value) …
257 … virtual bool IsAnnotationRecordAttribute([[maybe_unused]] const std::string_view &attribute) const in IsAnnotationRecordAttribute()
262 virtual bool IsAnnotationIdAttribute([[maybe_unused]] const std::string_view &attribute) const in IsAnnotationIdAttribute()
267 …virtual bool IsAnnotationElementTypeAttribute([[maybe_unused]] const std::string_view &attribute) … in IsAnnotationElementTypeAttribute()
273 [[maybe_unused]] const std::string_view &attribute) const in IsAnnotationElementArrayComponentTypeAttribute()
278 …virtual bool IsAnnotationElementNameAttribute([[maybe_unused]] const std::string_view &attribute) … in IsAnnotationElementNameAttribute()
283 …virtual bool IsAnnotationElementValueAttribute([[maybe_unused]] const std::string_view &attribute)… in IsAnnotationElementValueAttribute()
291 void Initialize(const std::string_view &name) in Initialize()
317 std::optional<Error> AddValue(
318 const std::string_view &value,
319 … const std::unordered_map<std::string, std::unique_ptr<AnnotationData>> &annotation_id_map);
325 … std::make_unique<ArrayValue>(component_type_.value(), std::move(values_))); in CreateAnnotationElement()
328 return AnnotationElement(name_, std::make_unique<ScalarValue>(values_.front())); in CreateAnnotationElement()
370 std::string name_;
371 std::optional<Value::Type> type_;
372 std::optional<Value::Type> component_type_;
373 std::vector<ScalarValue> values_;
378 void Initialize(const std::string_view &name) in Initialize()
392 void SetId(const std::string_view &id) in SetId()
397 std::string GetId() const in GetId()
405 elements_.push_back(std::forward<AnnotationElement>(element)); in AddElement()
408 std::unique_ptr<AnnotationData> CreateAnnotationData() in CreateAnnotationData()
410 return std::make_unique<AnnotationData>(name_, std::move(elements_)); in CreateAnnotationData()
413 void AddAnnnotationDataToVector(std::vector<AnnotationData> *annotations) in AddAnnnotationDataToVector()
415 annotations->emplace_back(name_, std::move(elements_)); in AddAnnnotationDataToVector()
429 std::string name_;
430 std::optional<std::string> id_;
431 std::vector<AnnotationElement> elements_;
435 std::optional<Metadata::Error> MeetExpRecordAttribute(const std::string_view &attribute,
436 const std::string_view &value);
437 …std::optional<Metadata::Error> MeetExpIdAttribute(const std::string_view &attribute, const std::st…
438 std::optional<Metadata::Error> MeetExpElementNameAttribute(const std::string_view &attribute,
439 const std::string_view &value);
440 std::optional<Metadata::Error> MeetExpElementTypeAttribute(const std::string_view &attribute,
441 const std::string_view &value);
442 …std::optional<Metadata::Error> MeetExpElementArrayComponentTypeAttribute(const std::string_view &a…
443 … const std::string_view &value);
444 std::optional<Metadata::Error> MeetExpElementValueAttribute(const std::string_view &attribute,
445 const std::string_view &value);
447 void InitializeAnnotationBuilder(const std::string_view &name) in InitializeAnnotationBuilder()
478 void InitializeAnnotationElementBuilder(const std::string_view &name) in InitializeAnnotationElementBuilder()
504 std::vector<AnnotationData> annotations_;
505 std::unordered_map<std::string, std::unique_ptr<AnnotationData>> id_map_;
533 virtual std::string GetBase() const;
535 virtual std::vector<std::string> GetInterfaces() const;
546 std::optional<Error> Validate(const std::string_view &attribute) const override;
548 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
550 void SetFlags(const std::string_view &attribute) override;
552 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
554 void RemoveFlags(const std::string_view &attribute) override;
556 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
576 std::optional<ScalarValue> GetValue() const in GetValue()
582 …std::optional<Error> StoreValue(const std::string_view &attribute, const std::string_view &value) …
584 std::optional<Error> Validate(const std::string_view &attribute) const override;
586 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
588 void SetFlags(const std::string_view &attribute) override;
590 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
592 void RemoveFlags(const std::string_view &attribute) override;
594 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
596 virtual bool IsValueAttribute(const std::string_view &attribute) in IsValueAttribute()
603 std::optional<ScalarValue> value_;
613 std::optional<Error> Validate(const std::string_view &attribute) const override;
615 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
617 void SetFlags(const std::string_view &attribute) override;
619 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
621 void RemoveFlags(const std::string_view &attribute) override;
623 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;
628 std::optional<Error> Validate(const std::string_view &attribute) const override;
630 …std::optional<Error> Validate(const std::string_view &attribute, const std::string_view &value) co…
632 void SetFlags(const std::string_view &attribute) override;
634 void SetFlags(const std::string_view &attribute, const std::string_view &value) override;
636 void RemoveFlags(const std::string_view &attribute) override;
638 void RemoveFlags(const std::string_view &attribute, const std::string_view &value) override;