Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DownloadDb Class Reference

#include <downloadDb.h>

List of all members.

Public Types

typedef pvector< PT(FileRecordFileRecords )
typedef pvector< PT(MultifileRecordMultifileRecords )
typedef pvector< HashValVectorHash
typedef pmap< Filename, VectorHashVersionMap

Public Member Functions

Db read_db (Ramfile &file, bool want_server_info)
bool write_db (Filename &file, Db db, bool want_server_info)
void insert_new_version (const Filename &name, const HashVal &hash)
bool has_version (const Filename &name) const
int get_num_versions (const Filename &name) const
void set_num_versions (const Filename &name, int num_versions)
int get_version (const Filename &name, const HashVal &hash) const
const HashValget_hash (const Filename &name, int version) const

Public Attributes

PUBLISHED __pad1__: Db read_db(Filename &file
PUBLISHED bool want_server_info
Db _client_db
Db _server_db
PUBLISHED __pad2__: void add_version(const Filename &name
PUBLISHED const HashValhash
PUBLISHED const HashVal int version

Static Public Attributes

PN_uint32 _magic_number = 0xfeedfeed
PN_uint32 _bogus_magic_number = 0x11111111

Protected Member Functions

void write_version_map (ofstream &write_stream)
bool read_version_map (istream &read_stream)

Protected Attributes

VersionMap _versions
Datagram _master_datagram

Private Member Functions

 DownloadDb (void)
 DownloadDb (Ramfile &server_file, Filename &client_file)
 DownloadDb (Filename &server_file, Filename &client_file)
 ~DownloadDb (void)
void output (ostream &out) const
void write (ostream &out) const
void write_version_map (ostream &out) const
bool write_client_db (Filename &file)
bool write_server_db (Filename &file)
INLINE int get_client_num_multifiles (void) const
INLINE int get_server_num_multifiles (void) const
INLINE string get_client_multifile_name (int index) const
INLINE string get_server_multifile_name (int index) const
INLINE int get_client_multifile_size (string mfname) const
INLINE void set_client_multifile_size (string mfname, int size)
INLINE int set_client_multifile_delta_size (string mfname, int size)
INLINE int get_server_multifile_size (string mfname) const
INLINE void set_server_multifile_size (string mfname, int size)
INLINE Phase get_client_multifile_phase (string mfname) const
INLINE Phase get_server_multifile_phase (string mfname) const
INLINE void set_client_multifile_incomplete (string mfname)
INLINE void set_client_multifile_complete (string mfname)
INLINE void set_client_multifile_decompressed (string mfname)
INLINE void set_client_multifile_extracted (string mfname)
INLINE int get_server_num_files (string mfname) const
INLINE string get_server_file_name (string mfname, int index) const
bool client_multifile_exists (string mfname) const
bool client_multifile_complete (string mfname) const
bool client_multifile_decompressed (string mfname) const
bool client_multifile_extracted (string mfname) const
HashVal get_client_multifile_hash (string mfname) const
void set_client_multifile_hash (string mfname, HashVal val)
HashVal get_server_multifile_hash (string mfname) const
void set_server_multifile_hash (string mfname, HashVal val)
void delete_client_multifile (string mfname)
void add_client_multifile (string server_mfname)
void expand_client_multifile (string mfname)
void create_new_server_db ()
void server_add_multifile (string mfname, Phase phase, int size, int status)
void server_add_file (string mfname, string fname)

Private Attributes

PUBLISHED __pad0__: enum Status { Status_incomplete = 0
PUBLISHED Status_complete = 1
PUBLISHED Status_decompressed = 2
PUBLISHED Status_extracted


Member Typedef Documentation

typedef pvector< PT(FileRecord) DownloadDb::FileRecords)
 

Definition at line 149 of file downloadDb.h.

typedef pvector< PT(MultifileRecord) DownloadDb::MultifileRecords)
 

Definition at line 170 of file downloadDb.h.

typedef pvector<HashVal> DownloadDb::VectorHash
 

Definition at line 213 of file downloadDb.h.

Referenced by get_hash(), get_version(), insert_new_version(), and set_num_versions().

typedef pmap<Filename, VectorHash> DownloadDb::VersionMap
 

Definition at line 214 of file downloadDb.h.


Constructor & Destructor Documentation

DownloadDb::DownloadDb void   )  [private]
 

Definition at line 88 of file downloadDb.cxx.

References _client_db, and _server_db.

DownloadDb::DownloadDb Ramfile server_file,
Filename &  client_file
[private]
 

Definition at line 57 of file downloadDb.cxx.

References _client_db, DownloadDb::Db::_filename, _server_db, and read_db().

DownloadDb::DownloadDb Filename &  server_file,
Filename &  client_file
[private]
 

Definition at line 72 of file downloadDb.cxx.

References _client_db, DownloadDb::Db::_filename, _server_db, and read_db().

DownloadDb::~DownloadDb void   )  [private]
 

Definition at line 99 of file downloadDb.cxx.


Member Function Documentation

void DownloadDb::add_client_multifile string  server_mfname  )  [private]
 

Definition at line 266 of file downloadDb.cxx.

References _client_db, _server_db, DownloadDb::Db::add_multifile_record(), and PT.

bool DownloadDb::client_multifile_complete string  mfname  )  const [private]
 

Definition at line 177 of file downloadDb.cxx.

References _client_db, and Status_complete.

bool DownloadDb::client_multifile_decompressed string  mfname  )  const [private]
 

Definition at line 188 of file downloadDb.cxx.

References _client_db, and Status_decompressed.

bool DownloadDb::client_multifile_exists string  mfname  )  const [private]
 

Definition at line 165 of file downloadDb.cxx.

References _client_db, and DownloadDb::Db::multifile_exists().

bool DownloadDb::client_multifile_extracted string  mfname  )  const [private]
 

Definition at line 199 of file downloadDb.cxx.

References _client_db, and Status_extracted.

void DownloadDb::create_new_server_db  )  [private]
 

Definition at line 388 of file downloadDb.cxx.

References _server_db.

void DownloadDb::delete_client_multifile string  mfname  )  [private]
 

Definition at line 257 of file downloadDb.cxx.

void DownloadDb::expand_client_multifile string  mfname  )  [private]
 

Definition at line 281 of file downloadDb.cxx.

HashVal DownloadDb::get_client_multifile_hash string  mfname  )  const [private]
 

Definition at line 211 of file downloadDb.cxx.

References _client_db.

INLINE string DownloadDb::get_client_multifile_name int  index  )  const [private]
 

INLINE Phase DownloadDb::get_client_multifile_phase string  mfname  )  const [private]
 

INLINE int DownloadDb::get_client_multifile_size string  mfname  )  const [private]
 

INLINE int DownloadDb::get_client_num_multifiles void   )  const [private]
 

const HashVal & DownloadDb::get_hash const Filename &  name,
int  version
const
 

Definition at line 1208 of file downloadDb.cxx.

References _versions, and VectorHash.

int DownloadDb::get_num_versions const Filename &  name  )  const
 

Definition at line 1146 of file downloadDb.cxx.

References _versions.

INLINE string DownloadDb::get_server_file_name string  mfname,
int  index
const [private]
 

HashVal DownloadDb::get_server_multifile_hash string  mfname  )  const [private]
 

Definition at line 222 of file downloadDb.cxx.

References _server_db.

INLINE string DownloadDb::get_server_multifile_name int  index  )  const [private]
 

INLINE Phase DownloadDb::get_server_multifile_phase string  mfname  )  const [private]
 

INLINE int DownloadDb::get_server_multifile_size string  mfname  )  const [private]
 

INLINE int DownloadDb::get_server_num_files string  mfname  )  const [private]
 

INLINE int DownloadDb::get_server_num_multifiles void   )  const [private]
 

int DownloadDb::get_version const Filename &  name,
const HashVal hash
const
 

Definition at line 1185 of file downloadDb.cxx.

References _versions, and VectorHash.

bool DownloadDb::has_version const Filename &  name  )  const
 

Definition at line 1135 of file downloadDb.cxx.

References _versions.

void DownloadDb::insert_new_version const Filename &  name,
const HashVal hash
 

Definition at line 1122 of file downloadDb.cxx.

References _versions, and VectorHash.

void DownloadDb::output ostream &  out  )  const [private]
 

Definition at line 112 of file downloadDb.cxx.

References _client_db, DownloadDb::Db::_filename, and _server_db.

Referenced by operator<<().

DownloadDb::Db DownloadDb::read_db Ramfile file,
bool  want_server_info
 

Definition at line 328 of file downloadDb.cxx.

References Ramfile::_data, DownloadDb::Db::read(), and read_version_map().

Referenced by DownloadDb().

bool DownloadDb::read_version_map istream &  read_stream  )  [protected]
 

Definition at line 1271 of file downloadDb.cxx.

References _master_datagram, Datagram::append_data(), buffer, Datagram::clear(), DatagramIterator::extract_bytes(), DatagramIterator::get_int32(), DatagramIterator::get_uint32(), hash, length, PN_int32, PN_uint32, and HashVal::set_value().

Referenced by read_db().

void DownloadDb::server_add_file string  mfname,
string  fname
[private]
 

Definition at line 411 of file downloadDb.cxx.

References DownloadDb::Db::_mfile_records, _server_db, and PT.

void DownloadDb::server_add_multifile string  mfname,
Phase  phase,
int  size,
int  status
[private]
 

Definition at line 399 of file downloadDb.cxx.

References _server_db, DownloadDb::Db::add_multifile_record(), and PT.

INLINE void DownloadDb::set_client_multifile_complete string  mfname  )  [private]
 

INLINE void DownloadDb::set_client_multifile_decompressed string  mfname  )  [private]
 

INLINE int DownloadDb::set_client_multifile_delta_size string  mfname,
int  size
[private]
 

INLINE void DownloadDb::set_client_multifile_extracted string  mfname  )  [private]
 

void DownloadDb::set_client_multifile_hash string  mfname,
HashVal  val
[private]
 

Definition at line 233 of file downloadDb.cxx.

References _client_db, DownloadDb::Db::_filename, and write_client_db().

INLINE void DownloadDb::set_client_multifile_incomplete string  mfname  )  [private]
 

INLINE void DownloadDb::set_client_multifile_size string  mfname,
int  size
[private]
 

void DownloadDb::set_num_versions const Filename &  name,
int  num_versions
 

Definition at line 1163 of file downloadDb.cxx.

References _versions, and VectorHash.

void DownloadDb::set_server_multifile_hash string  mfname,
HashVal  val
[private]
 

Definition at line 245 of file downloadDb.cxx.

References _server_db.

INLINE void DownloadDb::set_server_multifile_size string  mfname,
int  size
[private]
 

void DownloadDb::write ostream &  out  )  const [private]
 

Definition at line 122 of file downloadDb.cxx.

References _client_db, DownloadDb::Db::_filename, _server_db, DownloadDb::Db::write(), and write_version_map().

Referenced by main().

bool DownloadDb::write_client_db Filename &  file  )  [private]
 

Definition at line 144 of file downloadDb.cxx.

References _client_db, and write_db().

Referenced by set_client_multifile_hash().

bool DownloadDb::write_db Filename &  file,
Db  db,
bool  want_server_info
 

Definition at line 355 of file downloadDb.cxx.

References DownloadDb::Db::write(), DownloadDb::Db::write_bogus_header(), DownloadDb::Db::write_header(), and write_version_map().

Referenced by write_client_db(), and write_server_db().

bool DownloadDb::write_server_db Filename &  file  )  [private]
 

Definition at line 155 of file downloadDb.cxx.

References _server_db, and write_db().

void DownloadDb::write_version_map ofstream &  write_stream  )  [protected]
 

Definition at line 1234 of file downloadDb.cxx.

References _master_datagram, _versions, Datagram::add_int32(), Datagram::add_uint32(), Datagram::append_data(), Datagram::clear(), Datagram::get_message(), HashVal::get_value(), and hash.

void DownloadDb::write_version_map ostream &  out  )  const [private]
 

Definition at line 1342 of file downloadDb.cxx.

References _versions, and hash.

Referenced by write(), and write_db().


Member Data Documentation

PUBLISHED DownloadDb::__pad0__ [private]
 

Definition at line 75 of file downloadDb.h.

PUBLISHED DownloadDb::__pad1__
 

Definition at line 200 of file downloadDb.h.

PUBLISHED DownloadDb::__pad2__
 

Definition at line 217 of file downloadDb.h.

PN_uint32 DownloadDb::_bogus_magic_number = 0x11111111 [static]
 

Definition at line 34 of file downloadDb.cxx.

Db DownloadDb::_client_db
 

Definition at line 207 of file downloadDb.h.

Referenced by add_client_multifile(), client_multifile_complete(), client_multifile_decompressed(), client_multifile_exists(), client_multifile_extracted(), DownloadDb(), get_client_multifile_hash(), output(), set_client_multifile_hash(), write(), and write_client_db().

PN_uint32 DownloadDb::_magic_number = 0xfeedfeed [static]
 

Definition at line 28 of file downloadDb.cxx.

Datagram DownloadDb::_master_datagram [protected]
 

Definition at line 230 of file downloadDb.h.

Referenced by read_version_map(), and write_version_map().

Db DownloadDb::_server_db
 

Definition at line 208 of file downloadDb.h.

Referenced by add_client_multifile(), create_new_server_db(), DownloadDb(), get_server_multifile_hash(), output(), server_add_file(), server_add_multifile(), set_server_multifile_hash(), write(), and write_server_db().

VersionMap DownloadDb::_versions [protected]
 

Definition at line 229 of file downloadDb.h.

Referenced by get_hash(), get_num_versions(), get_version(), has_version(), insert_new_version(), set_num_versions(), and write_version_map().

PUBLISHED const HashVal& DownloadDb::hash
 

Definition at line 217 of file downloadDb.h.

Referenced by read_version_map(), and write_version_map().

PUBLISHED DownloadDb::Status_complete = 1 [private]
 

Definition at line 76 of file downloadDb.h.

Referenced by client_multifile_complete().

PUBLISHED DownloadDb::Status_decompressed = 2 [private]
 

Definition at line 77 of file downloadDb.h.

Referenced by client_multifile_decompressed().

PUBLISHED DownloadDb::Status_extracted [private]
 

Initial value:

 3
  }

Definition at line 78 of file downloadDb.h.

Referenced by client_multifile_extracted().

PUBLISHED const HashVal int DownloadDb::version
 

Definition at line 217 of file downloadDb.h.

PUBLISHED bool DownloadDb::want_server_info
 

Definition at line 200 of file downloadDb.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:11:54 2003 for Panda by doxygen1.3