Пример #1
0
Value::Value(const Value& other) :
   Value()
{
   if (other.has_value()) {
      impl = other.impl->clone(clone_storage());
   }
}
Пример #2
0
const Value& Value::operator=( const Value& other)
{
   if (other.has_value()) {
      impl = other.impl->clone(clone_storage());
   } else {
      if (impl) {
         impl->~ValueImpl();
         impl = nullptr;
      }
   }

   return *this;
}
Пример #3
0
Value::Value(int32_t i) :
   Value()
{
   impl = new (clone_storage()) BSON::Type (Types::Int32(i));
}
Пример #4
0
Value::Value(const Key & key) :
   Value()
{
   impl = new (clone_storage()) BSON::Type (Types::Utf8(key.c_str()));
}
Пример #5
0
Value::Value(const char * str) :
   Value()
{
   impl = new (clone_storage()) BSON::Type (Types::Utf8(str));
}
Пример #6
0
Value::Value ( const ValueImpl & i) :
   Value()
{
   impl = i.clone(clone_storage());
}
	ContigStoragePtr Clone(){
		ContigStoragePtr clone_storage(new SimpleContigStorage());
		for(size_t i = 0; i < storage_.size(); i++)
			clone_storage->Add(storage_[i]);
		return clone_storage;
	}