partdata.cpp File Reference

#include <hn/hnprec.h>
#include <hn/partdata.h>
#include <hn/log.h>
#include <hn/lambda_placeholders.h>
#include <hn/metadata.h>
#include <hn/hasher.h>
#include <hn/hash.h>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/if.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <fstream>
#include <fcntl.h>

Include dependency graph for partdata.cpp:

Go to the source code of this file.


Namespaces

namespace  CGComm
namespace  Detail
namespace  boost::lambda
namespace  boost::multi_index

Typedefs

typedef ChunkMap::nth_index<
Detail::ID_Avail >::type 
CMAvailIndex
typedef ChunkMap::nth_index<
Detail::ID_Pos >::type 
CMPosIndex
typedef ChunkMap::nth_index<
Detail::ID_Verified >::type 
CMVerIndex
typedef ChunkMap::nth_index<
Detail::ID_Partial >::type 
CMPartIndex
typedef ChunkMap::nth_index<
Detail::ID_UseCnt >::type 
CMUseIndex
typedef ChunkMap::nth_index<
Detail::ID_Length >::type 
CMLenIndex

Enumerations

enum  PartDataOpCodes {
  OP_PD_VER = 0x01, OP_PARTDATA = 0x90, OP_PD_DOWNLOADED = 0x91, OP_PD_DESTINATION = 0x92,
  OP_PD_COMPLETED = 0x93, OP_PD_HASHSET = 0x94
}
 Opcodes used within PartData object I/O between streams. More...
enum  {
  ID_Pos, ID_Verified, ID_Partial, ID_Avail,
  ID_UseCnt, ID_Length
}

Functions

 IMPLEMENT_EVENT_TABLE (PartData, PartData *, int)
std::ostream & operator<< (std::ostream &o, const PartData &p)

Variables

static const uint32_t BUF_SIZE_LIMIT = 512*1024
 512k buffer
TruePred truepred
 Unary function object for usage with doGetRange() method.
CheckPred checkPred
 Unary function object for usage with doGetRange() method, in order to check if the generated range is contained within the rangelist passed within this function object.

Typedef Documentation

typedef ChunkMap::nth_index<Detail::ID_Avail >::type Detail::CMAvailIndex
 

Definition at line 158 of file partdata.cpp.

typedef ChunkMap::nth_index<Detail::ID_Length >::type Detail::CMLenIndex
 

Definition at line 163 of file partdata.cpp.

typedef ChunkMap::nth_index<Detail::ID_Partial >::type Detail::CMPartIndex
 

Definition at line 161 of file partdata.cpp.

typedef ChunkMap::nth_index<Detail::ID_Pos >::type Detail::CMPosIndex
 

Definition at line 159 of file partdata.cpp.

typedef ChunkMap::nth_index<Detail::ID_UseCnt >::type Detail::CMUseIndex
 

Definition at line 162 of file partdata.cpp.

typedef ChunkMap::nth_index<Detail::ID_Verified>::type Detail::CMVerIndex
 

Definition at line 160 of file partdata.cpp.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
ID_Pos 
ID_Verified 
ID_Partial 
ID_Avail 
ID_UseCnt 
ID_Length 

Definition at line 156 of file partdata.cpp.

enum PartDataOpCodes
 

Opcodes used within PartData object I/O between streams.

Enumeration values:
OP_PD_VER  uint8 File version
OP_PARTDATA  uint8 PartData object
OP_PD_DOWNLOADED  uint64 Downloaded data
OP_PD_DESTINATION  string Destination location
OP_PD_COMPLETED  FullRangeList completed ranges.
OP_PD_HASHSET  FullRangeList<HashBase*> hashset.

Definition at line 45 of file partdata.cpp.


Function Documentation

IMPLEMENT_EVENT_TABLE PartData  ,
PartData ,
int 
 

std::ostream& operator<< std::ostream &  o,
const PartData p
 

Definition at line 980 of file partdata.cpp.

References CGComm::OP_PARTDATA, CGComm::OP_PD_COMPLETED, CGComm::OP_PD_DESTINATION, CGComm::OP_PD_VER, and Utils::putVal().

Here is the call graph for this function:


Variable Documentation

const uint32_t BUF_SIZE_LIMIT = 512*1024 [static]
 

512k buffer

Definition at line 41 of file partdata.cpp.

Referenced by PartData::doWrite().

struct CheckPred checkPred
 

Unary function object for usage with doGetRange() method, in order to check if the generated range is contained within the rangelist passed within this function object.

Parameters:
r Range candidate to be checked
Returns:
True if
Parameters:
r is contained within m_rl, false otherwise

Referenced by PartData::getRange().

struct TruePred truepred
 

Unary function object for usage with doGetRange() method.

Parameters:
r Ignored
Returns:
Always true

Referenced by PartData::getRange().