diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-11 21:09:51 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-11 21:09:51 +0900 |
| commit | 7c06b903f3493db95fcf4bd42cccc59e3b4d0692 (patch) | |
| tree | f10a85795bb086e0b257a0e6c6c5ffb05f28f344 /src/ValueBaseStructParserStateMachine.h | |
| parent | 7a57ecc5f814dc305e5e4b9bd960d69b43870c0e (diff) | |
Use std::unique_ptr for ValueBase object hierarchy
Diffstat (limited to 'src/ValueBaseStructParserStateMachine.h')
| -rw-r--r-- | src/ValueBaseStructParserStateMachine.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ValueBaseStructParserStateMachine.h b/src/ValueBaseStructParserStateMachine.h index 38834438..a4b0c513 100644 --- a/src/ValueBaseStructParserStateMachine.h +++ b/src/ValueBaseStructParserStateMachine.h @@ -55,8 +55,8 @@ class ValueBaseStructParserState; // value holder. class ValueBaseStructParserStateMachine : public StructParserStateMachine { public: - typedef std::shared_ptr<ValueBase> ResultType; - static const std::shared_ptr<ValueBase>& noResult(); + typedef std::unique_ptr<ValueBase> ResultType; + static std::unique_ptr<ValueBase> noResult(); struct NumberData { int64_t number; @@ -82,7 +82,7 @@ public: CXX11_OVERRIDE; virtual void boolCallback(bool bval) CXX11_OVERRIDE; - std::shared_ptr<ValueBase> getResult() const; + std::unique_ptr<ValueBase> getResult(); virtual void reset() CXX11_OVERRIDE; @@ -93,9 +93,10 @@ public: void popArrayFrame(); void popDictFrame(); void pushFrame(); - void setCurrentFrameValue(const std::shared_ptr<ValueBase>& value); - const std::shared_ptr<ValueBase>& getCurrentFrameValue() const; - void setCurrentFrameName(const std::string& name); + void setCurrentFrameValue(std::unique_ptr<ValueBase> value); + const std::unique_ptr<ValueBase>& getCurrentFrameValue() const; + std::unique_ptr<ValueBase> popCurrentFrameValue(); + void setCurrentFrameName(std::string name); void pushDictState(); void pushDictKeyState(); @@ -107,7 +108,7 @@ public: void pushBoolState(); void pushNullState(); private: - rpc::XmlRpcRequestParserController* ctrl_; + std::unique_ptr<rpc::XmlRpcRequestParserController> ctrl_; std::stack<ValueBaseStructParserState*> stateStack_; SessionData sessionData_; }; |
