Commit f86ab668 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #40 from jparyani/master

Add zero arg constructor and `getType` to DynamicValue::Pipeline
parents 5d6ff087 cc180076
...@@ -739,6 +739,7 @@ class DynamicValue::Pipeline { ...@@ -739,6 +739,7 @@ class DynamicValue::Pipeline {
public: public:
typedef DynamicValue Pipelines; typedef DynamicValue Pipelines;
inline Pipeline(decltype(nullptr) n = nullptr);
inline Pipeline(DynamicStruct::Pipeline&& value); inline Pipeline(DynamicStruct::Pipeline&& value);
inline Pipeline(DynamicCapability::Client&& value); inline Pipeline(DynamicCapability::Client&& value);
...@@ -749,6 +750,9 @@ public: ...@@ -749,6 +750,9 @@ public:
template <typename T> template <typename T>
inline PipelineFor<T> releaseAs() { return AsImpl<T>::apply(*this); } inline PipelineFor<T> releaseAs() { return AsImpl<T>::apply(*this); }
inline Type getType() { return type; }
// Get the type of this value.
private: private:
Type type; Type type;
union { union {
...@@ -1366,6 +1370,7 @@ struct DynamicValue::Builder::AsImpl<T, Kind::INTERFACE> { ...@@ -1366,6 +1370,7 @@ struct DynamicValue::Builder::AsImpl<T, Kind::INTERFACE> {
} }
}; };
inline DynamicValue::Pipeline::Pipeline(std::nullptr_t n): type(UNKNOWN) {}
inline DynamicValue::Pipeline::Pipeline(DynamicStruct::Pipeline&& value) inline DynamicValue::Pipeline::Pipeline(DynamicStruct::Pipeline&& value)
: type(STRUCT), structValue(kj::mv(value)) {} : type(STRUCT), structValue(kj::mv(value)) {}
inline DynamicValue::Pipeline::Pipeline(DynamicCapability::Client&& value) inline DynamicValue::Pipeline::Pipeline(DynamicCapability::Client&& value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment