text: /*
   * NetworkDatabaseValueFactory.cpp
   *
   *  Created on: 2022/02/22
   *      Author: iizuka
   */
  
  #include "p2p_netdb/NetworkDatabaseValueFactory.h"
  #include "p2p_netdb/NetworkEntry.h"
  
  #include "base_io/ByteBuffer.h"
  
  #include <cassert>
  
  
  namespace codablecash {
  
  NetworkDatabaseValueFactory::NetworkDatabaseValueFactory() {
  
  }
  
  NetworkDatabaseValueFactory::~NetworkDatabaseValueFactory() {
  
  }
  
  IBlockObject* NetworkDatabaseValueFactory::makeDataFromBinary(ByteBuffer* in) {
  	uint32_t type = in->getInt();
  
  	assert(type == NetworkDatabaseValueFactory::TYPE_NETWORK_ENTITY);
  
  	NetworkEntry* entry = new NetworkEntry();
  	entry->fromBinary(in);
  
  	return entry;
  }
  
  AbstractBtreeDataFactory* codablecash::NetworkDatabaseValueFactory::copy() const noexcept {
  	return new NetworkDatabaseValueFactory();
  }
  
  
  } /* namespace codablecash */
  