new enum type for OutputFormat, add level/pollprio/condition to HTTP GET and extend message key by circuit/direction/condition for OF_ALL_ATTRS, start message dump in JSON format

This commit is contained in:
John
2021-04-02 10:41:50 +02:00
parent dc1a1ecc56
commit 38bfc7a751
13 changed files with 264 additions and 200 deletions
+12 -12
View File
@@ -122,11 +122,11 @@ class AttributedItem {
/**
* Dump the attribute optionally embedded in @a TEXT_SEPARATOR to the output.
* @param prependFieldSeparator whether to start with a @a FIELD_SEPARATOR.
* @param asJson whether to output in JSON format.
* @param outputFormat the @a OutputFormat options.
* @param name the name of the attribute to dump.
* @param output the @a ostream to dump to.
*/
void dumpAttribute(bool prependFieldSeparator, bool asJson, const string& name, ostream* output) const;
void dumpAttribute(bool prependFieldSeparator, OutputFormat outputFormat, const string& name, ostream* output) const;
/**
* Append the attribute value to the output.
@@ -273,10 +273,10 @@ class DataField : public AttributedItem {
/**
* Dump the field settings to the output.
* @param prependFieldSeparator whether to start with a @a FIELD_SEPARATOR.
* @param asJson whether to output in JSON format.
* @param outputFormat the @a OutputFormat options.
* @param output the @a ostream to dump to.
*/
virtual void dump(bool prependFieldSeparator, bool asJson, ostream* output) const = 0;
virtual void dump(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const = 0;
/**
* Return whether the field is available.
@@ -420,20 +420,20 @@ class SingleDataField : public DataField {
/**
* Dump the common prefix field settings to the output (name and part type).
* @param prependFieldSeparator whether to start with a @a FIELD_SEPARATOR.
* @param asJson whether to output in JSON format.
* @param outputFormat the @a OutputFormat options.
* @param output the @a ostream to dump to.
*/
void dumpPrefix(bool prependFieldSeparator, bool asJson, ostream* output) const;
void dumpPrefix(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const;
/**
* Dump the common suffix field settings to the output (optional unit and comment).
* @param asJson whether to output in JSON format.
* @param outputFormat the @a OutputFormat options.
* @param output the @a ostream to dump to.
*/
void dumpSuffix(bool asJson, ostream* output) const;
void dumpSuffix(OutputFormat outputFormat, ostream* output) const;
// @copydoc
void dump(bool prependFieldSeparator, bool asJson, ostream* output) const override;
void dump(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const override;
// @copydoc
bool hasField(const char* fieldName, bool numeric) const override;
@@ -519,7 +519,7 @@ class ValueListDataField : public SingleDataField {
vector<const SingleDataField*>* fields) const override;
// @copydoc
void dump(bool prependFieldSeparator, bool asJson, ostream* output) const override;
void dump(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const override;
protected:
@@ -572,7 +572,7 @@ class ConstantDataField : public SingleDataField {
vector<const SingleDataField*>* fields) const override;
// @copydoc
void dump(bool prependFieldSeparator, bool asJson, ostream* output) const override;
void dump(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const override;
protected:
@@ -685,7 +685,7 @@ class DataFieldSet : public DataField {
bool hasField(const char* fieldName, bool numeric) const override;
// @copydoc
void dump(bool prependFieldSeparator, bool asJson, ostream* output) const override;
void dump(bool prependFieldSeparator, OutputFormat outputFormat, ostream* output) const override;
// @copydoc
result_t read(const SymbolString& data, size_t offset,