Commit 027ec3453efbeb847217f169c9c2aed22cba26bd

Authored by Josh Klontz
1 parent da6568e2

introduced Format::write

sdk/openbr_plugin.h
@@ -845,6 +845,7 @@ class BR_EXPORT Format : public Object @@ -845,6 +845,7 @@ class BR_EXPORT Format : public Object
845 public: 845 public:
846 virtual ~Format() {} 846 virtual ~Format() {}
847 virtual Template read() const = 0; /*!< \brief Returns a br::Template created by reading #br::Object::file. */ 847 virtual Template read() const = 0; /*!< \brief Returns a br::Template created by reading #br::Object::file. */
  848 + virtual void write(const Template &t) const = 0; /*!< \brief Writes the br::Template to #br::Object::file. */
848 }; 849 };
849 850
850 /*! 851 /*!
sdk/plugins/format.cpp
@@ -63,6 +63,12 @@ class csvFormat : public Format @@ -63,6 +63,12 @@ class csvFormat : public Format
63 63
64 return Template(m); 64 return Template(m);
65 } 65 }
  66 +
  67 + void write(const Template &t) const
  68 + {
  69 + (void) t;
  70 + qFatal("csvFormat::write not supported.");
  71 + }
66 }; 72 };
67 73
68 BR_REGISTER(Format, csvFormat) 74 BR_REGISTER(Format, csvFormat)
@@ -105,6 +111,12 @@ class DefaultFormat : public Format @@ -105,6 +111,12 @@ class DefaultFormat : public Format
105 111
106 return t; 112 return t;
107 } 113 }
  114 +
  115 + void write(const Template &t) const
  116 + {
  117 + (void) t;
  118 + qFatal("csvFormat::write not supported.");
  119 + }
108 }; 120 };
109 121
110 BR_REGISTER(Format, DefaultFormat) 122 BR_REGISTER(Format, DefaultFormat)
@@ -129,6 +141,12 @@ class webcamFormat : public Format @@ -129,6 +141,12 @@ class webcamFormat : public Format
129 videoCapture->read(m); 141 videoCapture->read(m);
130 return Template(m); 142 return Template(m);
131 } 143 }
  144 +
  145 + void write(const Template &t) const
  146 + {
  147 + (void) t;
  148 + qFatal("webcamFormat::write not supported.");
  149 + }
132 }; 150 };
133 151
134 BR_REGISTER(Format, webcamFormat) 152 BR_REGISTER(Format, webcamFormat)
@@ -191,6 +209,12 @@ class xmlFormat : public Format @@ -191,6 +209,12 @@ class xmlFormat : public Format
191 209
192 return t; 210 return t;
193 } 211 }
  212 +
  213 + void write(const Template &t) const
  214 + {
  215 + (void) t;
  216 + qFatal("xmlFormat::write not supported.");
  217 + }
194 }; 218 };
195 219
196 BR_REGISTER(Format, xmlFormat) 220 BR_REGISTER(Format, xmlFormat)