Loading...
Searching...
No Matches
casacore::Casarc Class Reference

`#include <Casarc.h>`

## Classes

class | meta_entry_

## Public Types

typedef std::map< std::string, std::string >::const_iterator | iterator

## Public Member Functions

void | put (const std::string &keyword, const std::string &value)
| adds the keyword->value mapping
std::string | get (const std::string &keyword)
| retrieves the mapping for keyword (or "" if the mapping is not defined)
bool | get (const std::string &keyword, std::string &value)
| retrieves the mapping for keyword in value (and returns true if the mapping is defined or false otherwise)
size_t | size () const
const std::string & | path () const
| path to the file that this Casarc mirrors...
iterator | begin ()
iterator | end ()

## Static Public Member Functions

static Casarc & | instance ()
| return default casarc file, e.g.
static void | setDefaultPath (const std::string &path)
| set and clear the default casarc path (to something other than ~/.casarc)
static void | clearDefaultPath ()
static Casarc & | instance (const std::string &path)
| return a casarc object attached to a particular file
static const std::list< Casarc * > & | list ()
| return the list of rcfiles that have been loaded

## Private Types

enum | lock_mode { READ , READ_WRITE , WRITE , APPEND }

## Private Member Functions

void | close (int)
int | lock (lock_mode mode)
| returns a file descriptor or -1 on error...
void | unlock (int fd)
void | sync ()
double | current_modification_time (struct stat &buf)
void | read_file ()
| Casarc (const std::string &path)
| path is the path to the.casarc (or.aipsrc file)
| ~Casarc ()

## Static Private Member Functions

static void | startup ()
static void | shutdown ()

## Private Attributes

char * | mapped_file
off_t | mapped_file_size
std::list< int > | stale_fds
std::list< pid_t > | have_lock
std::string | filename
double | timestamp
std::map< std::string, std::string > | rcmap
std::map< std::string, meta_entry_ > | rcmetamap
| this is broken off separate from the rcmap to allow the rcmap to be used for iteration by users of this class...
ino_t | inode

## Static Private Attributes

static std::map< ino_t, Casarc * > * | rcfiles
| singleton Casarcs, (inode->casarc)
static std::map< std::string, Casarc * > * | filenames
static std::list< Casarc * > * | rclist
static std::string * | default_path
static bool | initialized

## Friends

class | CasarcCleanup

## Detailed Description

Definition at line 38 of file Casarc.h.

## Member Typedef Documentation

## iterator

typedef std::map<std::string,std::string>::const_iterator casacore::Casarc::iterator

Definition at line 44 of file Casarc.h.

## Member Enumeration Documentation

## lock_mode

enum casacore::Casarc::lock_mode

private

Enumerator
READ |
READ_WRITE |
WRITE |
APPEND |

Definition at line 112 of file Casarc.h.

## Constructor & Destructor Documentation

## Casarc()

casacore::Casarc::Casarc | ( | const std::string & | path | ) |

private

path is the path to the.casarc (or.aipsrc file)

References path().

Referenced by instance(), and instance().

## ~Casarc()

casacore::Casarc::~Casarc | ( |  | ) |

inline private

Definition at line 142 of file Casarc.h.

## Member Function Documentation

## begin()

iterator casacore::Casarc::begin | ( |  | ) |

## clearDefaultPath()

void casacore::Casarc::clearDefaultPath | ( |  | ) |

static

## close()

void casacore::Casarc::close | ( | int |  | ) |

private

## current_modification_time()

double casacore::Casarc::current_modification_time | ( | struct stat & | buf | ) |

private

## end()

iterator casacore::Casarc::end | ( |  | ) |

## get() [1/2]

std::string casacore::Casarc::get | ( | const std::string & | keyword | ) |

retrieves the mapping for keyword (or "" if the mapping is not defined)

## get() [2/2]

bool casacore::Casarc::get | ( | const std::string & | keyword,
|  | std::string & | value )

retrieves the mapping for keyword in value (and returns true if the mapping is defined or false otherwise)

References casacore::NewDelAllocator< T >::value.

## instance() [1/2]

Casarc & casacore::Casarc::instance | ( |  | ) |

static

return default casarc file, e.g.

~/.casarc

References Casarc().

## instance() [2/2]

Casarc & casacore::Casarc::instance | ( | const std::string & | path | ) |

static

return a casarc object attached to a particular file

References Casarc(), and path().

## list()

const std::list< Casarc * > & casacore::Casarc::list | ( |  | ) |

static

return the list of rcfiles that have been loaded

## lock()

int casacore::Casarc::lock | ( | lock_mode | mode | ) |

private

returns a file descriptor or -1 on error...

## path()

const std::string & casacore::Casarc::path | ( |  | ) | const

inline

path to the file that this Casarc mirrors...

Definition at line 72 of file Casarc.h.

References filename.

Referenced by Casarc(), instance(), and setDefaultPath().

## put()

void casacore::Casarc::put | ( | const std::string & | keyword,
|  | const std::string & | value )

adds the keyword->value mapping

References casacore::NewDelAllocator< T >::value.

## read_file()

void casacore::Casarc::read_file | ( |  | ) |

private

## setDefaultPath()

void casacore::Casarc::setDefaultPath | ( | const std::string & | path | ) |

static

set and clear the default casarc path (to something other than ~/.casarc)

References path().

## shutdown()

void casacore::Casarc::shutdown | ( |  | ) |

static private

Referenced by casacore::CasarcCleanup::~CasarcCleanup().

## size()

size_t casacore::Casarc::size | ( |  | ) | const

## startup()

void casacore::Casarc::startup | ( |  | ) |

static private

## sync()

void casacore::Casarc::sync | ( |  | ) |

private

## unlock()

void casacore::Casarc::unlock | ( | int | fd | ) |

private

## Friends And Related Symbol Documentation

## CasarcCleanup

friend class CasarcCleanup

friend

Definition at line 40 of file Casarc.h.

References CasarcCleanup.

Referenced by CasarcCleanup.

## Member Data Documentation

## default_path

std::string* casacore::Casarc::default_path

static private

Definition at line 136 of file Casarc.h.

## filename

std::string casacore::Casarc::filename

private

Definition at line 120 of file Casarc.h.

Referenced by path().

## filenames

std::map<std::string,Casarc*>* casacore::Casarc::filenames

static private

Definition at line 134 of file Casarc.h.

## have_lock

std::list<pid_t> casacore::Casarc::have_lock

private

Definition at line 110 of file Casarc.h.

## initialized

bool casacore::Casarc::initialized

static private

Definition at line 139 of file Casarc.h.

## inode

ino_t casacore::Casarc::inode

private

Definition at line 130 of file Casarc.h.

## mapped_file

char* casacore::Casarc::mapped_file

private

Definition at line 104 of file Casarc.h.

## mapped_file_size

off_t casacore::Casarc::mapped_file_size

private

Definition at line 105 of file Casarc.h.

## rcfiles

std::map<ino_t,Casarc*>* casacore::Casarc::rcfiles

static private

singleton Casarcs, (inode->casarc)

Definition at line 133 of file Casarc.h.

## rclist

std::list<Casarc*>* casacore::Casarc::rclist

static private

Definition at line 135 of file Casarc.h.

## rcmap

std::map<std::string,std::string> casacore::Casarc::rcmap

private

Definition at line 123 of file Casarc.h.

## rcmetamap

std::map<std::string,meta_entry_> casacore::Casarc::rcmetamap

private

this is broken off separate from the rcmap to allow the rcmap to be used for iteration by users of this class...

Definition at line 126 of file Casarc.h.

## stale_fds

std::list<int> casacore::Casarc::stale_fds

private

Definition at line 107 of file Casarc.h.

## timestamp

double casacore::Casarc::timestamp

private

Definition at line 121 of file Casarc.h.

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

- casa/System/Casarc.h