Smaller compile fixes for the new opaque serialization.

Also remove the non-existing clone function for EntrypyVals - which now
can just use serialization :)
This commit is contained in:
Johanna Amann 2019-06-17 14:48:02 -07:00
parent a50b06d6c1
commit 618f0802f4
8 changed files with 21 additions and 29 deletions

View file

@ -21,14 +21,12 @@ public:
/**
* Return's a unique ID for the type of an opaque value.
* @param v opaque value to return type for; it's classmust have been
* @param v opaque value to return type for; its class must have been
* registered with the manager, otherwise this method will abort
* execugtion.
* execution.
*
* @return type ID, which can used with *Instantiate()* to create a
* new
* instnace of the same type.
* new instance of the same type.
*/
const std::string& TypeID(const OpaqueVal* v) const;
@ -66,8 +64,8 @@ private:
/** Macro to insert into an OpaqueVal-derived class's declaration. */
#define DECLARE_OPAQUE_VALUE(T) \
friend class OpaqueMgr::Register<T>; \
broker::data DoSerialize() const; \
bool DoUnserialize(const broker::data& data); \
broker::data DoSerialize() const override; \
bool DoUnserialize(const broker::data& data) override; \
const char* OpaqueName() const override { return #T; } \
static OpaqueVal* OpaqueInstantiate() { return new T(); }
@ -90,7 +88,7 @@ public:
/**
* Serializes the value into a Broker representation.
*
* @return the broker representatio, or an error if serialization
* @return the broker representation, or an error if serialization
* isn't supported or failed.
*/
broker::expected<broker::data> Serialize() const;
@ -244,8 +242,6 @@ class EntropyVal : public OpaqueVal {
public:
EntropyVal();
Val* DoClone(CloneState* state) override;
bool Feed(const void* data, size_t size);
bool Get(double *r_ent, double *r_chisq, double *r_mean,
double *r_montepicalc, double *r_scc);