copy functions take and return shared_ptrs

This commit is contained in:
woodser
2019-07-29 15:19:51 -04:00
parent 835e04e785
commit ede2ba0c96
4 changed files with 78 additions and 144 deletions
+4 -20
View File
@@ -175,16 +175,8 @@ namespace monero {
// ------------------------------- MONERO TX --------------------------------
MoneroTx::MoneroTx() {
}
MoneroTx::MoneroTx(const MoneroTx& tx) {
throw runtime_error("MoneroTx deep copy constructor not implemented");
}
shared_ptr<MoneroTx> MoneroTx::copy() const {
return make_shared<MoneroTx>(*this);
shared_ptr<MoneroTx> MoneroTx::copy(const shared_ptr<MoneroTx>& self) const {
throw runtime_error("MoneroTx::copy() not implemented");
}
boost::property_tree::ptree MoneroTx::toPropertyTree() const {
@@ -378,16 +370,8 @@ namespace monero {
// ------------------------------ MONERO OUTPUT -----------------------------
MoneroOutput::MoneroOutput() {
}
MoneroOutput::MoneroOutput(const MoneroOutput& output) {
throw runtime_error("MoneroOutput deep copy not implemented");
}
shared_ptr<MoneroOutput> MoneroOutput::copy() const {
return make_shared<MoneroOutput>(*this);
shared_ptr<MoneroOutput> MoneroOutput::copy(const shared_ptr<MoneroOutput>& self) const {
throw runtime_error("MoneroOutput::copy() not implemented");
}
boost::property_tree::ptree MoneroOutput::toPropertyTree() const {
+2 -6
View File
@@ -192,9 +192,7 @@ namespace monero {
boost::optional<string> maxUsedBlockId;
vector<string> signatures;
MoneroTx(); // default constructor
MoneroTx(const MoneroTx& tx); // deep copy constructor
shared_ptr<MoneroTx> copy() const;
shared_ptr<MoneroTx> copy(const shared_ptr<MoneroTx>& self) const;
boost::property_tree::ptree toPropertyTree() const;
virtual void merge(const shared_ptr<MoneroTx>& self, const shared_ptr<MoneroTx>& other);
boost::optional<uint64_t> getHeight() const;
@@ -222,9 +220,7 @@ namespace monero {
vector<uint32_t> ringOutputIndices;
boost::optional<string> stealthPublicKey;
MoneroOutput();
MoneroOutput(const MoneroOutput& output); // deep copy constructor
shared_ptr<MoneroOutput> copy() const;
shared_ptr<MoneroOutput> copy(const shared_ptr<MoneroOutput>& self) const;
boost::property_tree::ptree toPropertyTree() const;
virtual void merge(const shared_ptr<MoneroOutput>& self, const shared_ptr<MoneroOutput>& other);
};