Example #1
0
	void insert( const PropertyAccessor & pa, const Variant & insertKey, const Variant & value )
	{
		Key key;
		if (!createKey( pa, key ))
		{
			pa.insert( insertKey, value );
			return;
		}

		std::unique_ptr<ReflectedCollectionInsertCommandParameters> commandParameters( new ReflectedCollectionInsertCommandParameters() );
		commandParameters->id_ = key.first;
		commandParameters->path_ = key.second;
		commandParameters->key_ = insertKey;
		commandParameters->value_ = value;

		const auto itr = commands_.emplace( std::pair< Key, CommandInstancePtr >( key, commandManager_.queueCommand(
			getClassIdentifier<ReflectedCollectionInsertCommand>(), ObjectHandle( std::move( commandParameters ) ) ) ) );

		commandManager_.waitForInstance( itr->second );
		commands_.erase( itr );
	}