OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BackUpResourceTable Class Referenceabstract

#include <sandesh_map.h>

Inheritance diagram for BackUpResourceTable:
Collaboration diagram for BackUpResourceTable:

Public Member Functions

 BackUpResourceTable (ResourceBackupManager *manager, const std::string &name, const std::string &file_name)
 
virtual ~BackUpResourceTable ()
 
virtual bool WriteToFile ()=0
 
virtual void ReadFromFile ()=0
 
virtual void RestoreResource ()=0
 
bool TimerExpiry ()
 
void StartTimer ()
 
ResourceBackupManagerbackup_manager ()
 
Agentagent ()
 
void TriggerBackup ()
 
bool UpdateRequired ()
 
void EnqueueRestore (ResourceManager::KeyPtr key, ResourceManager::DataPtr data)
 
const std::string & backup_dir ()
 
const std::string & file_name_str ()
 
const std::string & file_name_prefix ()
 

Static Public Member Functions

static const std::string FindFile (const std::string &root, const std::string &file_ext)
 
static bool CalculateHashSum (const std::string &file_name, uint32_t *hashsum)
 

Static Public Attributes

static const uint8_t kFallBackCount = 6
 

Protected Member Functions

template<typename T1 , typename T2 >
bool WriteMapToFile (T1 *sandesh_data, const T2 &index_map)
 
template<typename T >
void ReadMapFromFile (T *sandesh_data, const std::string &root)
 

Protected Attributes

std::string backup_dir_
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (BackUpResourceTable)
 

Private Attributes

ResourceBackupManagerbackup_manager_
 
Agentagent_
 
std::string name_
 
Timertimer_
 
uint32_t backup_idle_timeout_
 
uint64_t last_modified_time_
 
uint8_t fall_back_count_
 
std::string file_name_str_
 
std::string file_name_prefix_
 

Detailed Description

Definition at line 18 of file sandesh_map.h.

Constructor & Destructor Documentation

BackUpResourceTable::BackUpResourceTable ( ResourceBackupManager manager,
const std::string &  name,
const std::string &  file_name 
)

Definition at line 29 of file sandesh_map.cc.

Here is the call graph for this function:

BackUpResourceTable::~BackUpResourceTable ( )
virtual

Definition at line 56 of file sandesh_map.cc.

Here is the call graph for this function:

Member Function Documentation

Agent* BackUpResourceTable::agent ( )
inline

Definition at line 34 of file sandesh_map.h.

const std::string& BackUpResourceTable::backup_dir ( )
inline

Definition at line 39 of file sandesh_map.h.

ResourceBackupManager* BackUpResourceTable::backup_manager ( )
inline

Definition at line 31 of file sandesh_map.h.

bool BackUpResourceTable::CalculateHashSum ( const std::string &  file_name,
uint32_t *  hashsum 
)
static

Definition at line 139 of file sandesh_map.cc.

Here is the call graph for this function:

BackUpResourceTable::DISALLOW_COPY_AND_ASSIGN ( BackUpResourceTable  )
private
void BackUpResourceTable::EnqueueRestore ( ResourceManager::KeyPtr  key,
ResourceManager::DataPtr  data 
)

Definition at line 100 of file sandesh_map.cc.

Here is the call graph for this function:

const std::string& BackUpResourceTable::file_name_prefix ( )
inline

Definition at line 45 of file sandesh_map.h.

const std::string& BackUpResourceTable::file_name_str ( )
inline

Definition at line 44 of file sandesh_map.h.

const std::string BackUpResourceTable::FindFile ( const std::string &  root,
const std::string &  file_ext 
)
static

Definition at line 198 of file sandesh_map.cc.

template<typename T >
void BackUpResourceTable::ReadMapFromFile ( T *  sandesh_data,
const std::string &  root 
)
protected

Definition at line 244 of file sandesh_map.cc.

Here is the call graph for this function:

void BackUpResourceTable::StartTimer ( )

Definition at line 74 of file sandesh_map.cc.

Here is the call graph for this function:

bool BackUpResourceTable::TimerExpiry ( )

Definition at line 61 of file sandesh_map.cc.

Here is the call graph for this function:

void BackUpResourceTable::TriggerBackup ( )

Definition at line 83 of file sandesh_map.cc.

Here is the call graph for this function:

bool BackUpResourceTable::UpdateRequired ( )

Definition at line 90 of file sandesh_map.cc.

Here is the call graph for this function:

template<typename T1 , typename T2 >
bool BackUpResourceTable::WriteMapToFile ( T1 *  sandesh_data,
const T2 &  index_map 
)
protected

Definition at line 158 of file sandesh_map.cc.

Here is the call graph for this function:

Member Data Documentation

Agent* BackUpResourceTable::agent_
private

Definition at line 55 of file sandesh_map.h.

std::string BackUpResourceTable::backup_dir_
protected

Definition at line 51 of file sandesh_map.h.

uint32_t BackUpResourceTable::backup_idle_timeout_
private

Definition at line 58 of file sandesh_map.h.

ResourceBackupManager* BackUpResourceTable::backup_manager_
private

Definition at line 54 of file sandesh_map.h.

uint8_t BackUpResourceTable::fall_back_count_
private

Definition at line 60 of file sandesh_map.h.

std::string BackUpResourceTable::file_name_prefix_
private

Definition at line 62 of file sandesh_map.h.

std::string BackUpResourceTable::file_name_str_
private

Definition at line 61 of file sandesh_map.h.

const uint8_t BackUpResourceTable::kFallBackCount = 6
static

Definition at line 20 of file sandesh_map.h.

uint64_t BackUpResourceTable::last_modified_time_
private

Definition at line 59 of file sandesh_map.h.

std::string BackUpResourceTable::name_
private

Definition at line 56 of file sandesh_map.h.

Timer* BackUpResourceTable::timer_
private

Definition at line 57 of file sandesh_map.h.


The documentation for this class was generated from the following files: