lsst.daf.persistence  16.0-5-g10498df+1
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst::daf::persistence::DbStorageLocation Class Reference

Location of a persisted Persistable instance in a database. More...

#include <DbStorageLocation.h>

Inheritance diagram for lsst::daf::persistence::DbStorageLocation:
lsst::daf::base::Citizen

Public Types

typedef std::shared_ptr< DbStorageLocationPtr
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 DbStorageLocation (void)
 Default constructor. More...
 
 DbStorageLocation (std::string const &url)
 Constructor from CORAL-style URL. More...
 
virtual ~DbStorageLocation (void)
 Destructor. More...
 
virtual std::string toString (void) const
 Produce a string (URL) representation of the DbStorageLocation. More...
 
virtual std::string getConnString (void) const
 Produce a CORAL-style connection string representation of the DbStorageLocation. More...
 
virtual std::string const & getDbType (void) const
 Accessor for database type. More...
 
virtual std::string const & getHostname (void) const
 Accessor for database hostname. More...
 
virtual std::string const & getPort (void) const
 Accessor for database port number. More...
 
virtual std::string const & getUsername (void) const
 Accessor for username. More...
 
virtual std::string const & getPassword (void) const
 Accessor for password. More...
 
virtual std::string const & getDbName (void) const
 Accessor for database name. More...
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 

Static Public Member Functions

static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int init ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 magicSentinel
 

Detailed Description

Location of a persisted Persistable instance in a database.

Provides database connection information for DbStorage. Can be initialized with either an all-in-one URL containing username and password information or a CORAL-style connection string URL with separate username and password.

Definition at line 58 of file DbStorageLocation.h.

Member Typedef Documentation

◆ Ptr

Definition at line 60 of file DbStorageLocation.h.

Constructor & Destructor Documentation

◆ DbStorageLocation() [1/2]

lsst::daf::persistence::DbStorageLocation::DbStorageLocation ( void  )

Default constructor.

Definition at line 55 of file DbStorageLocation.cc.

◆ DbStorageLocation() [2/2]

lsst::daf::persistence::DbStorageLocation::DbStorageLocation ( std::string const &  url)

Constructor from CORAL-style URL.

Parameters
[in]urlCORAL-style connection string (database type, hostname, port, database name)

Definition at line 64 of file DbStorageLocation.cc.

◆ ~DbStorageLocation()

lsst::daf::persistence::DbStorageLocation::~DbStorageLocation ( void  )
virtual

Destructor.

Definition at line 86 of file DbStorageLocation.cc.

Member Function Documentation

◆ getConnString()

std::string lsst::daf::persistence::DbStorageLocation::getConnString ( void  ) const
virtual

Produce a CORAL-style connection string representation of the DbStorageLocation.

Returns
String suitable for passing to CORAL functions

Definition at line 101 of file DbStorageLocation.cc.

◆ getDbName()

std::string const & lsst::daf::persistence::DbStorageLocation::getDbName ( void  ) const
virtual

Accessor for database name.

Returns
Reference to database name string.

Definition at line 143 of file DbStorageLocation.cc.

◆ getDbType()

std::string const & lsst::daf::persistence::DbStorageLocation::getDbType ( void  ) const
virtual

Accessor for database type.

Returns
Reference to database type string.

Definition at line 108 of file DbStorageLocation.cc.

◆ getHostname()

std::string const & lsst::daf::persistence::DbStorageLocation::getHostname ( void  ) const
virtual

Accessor for database hostname.

Returns
Reference to database hostname string.

Definition at line 115 of file DbStorageLocation.cc.

◆ getPassword()

std::string const & lsst::daf::persistence::DbStorageLocation::getPassword ( void  ) const
virtual

Accessor for password.

Returns
Reference to password string.

Definition at line 136 of file DbStorageLocation.cc.

◆ getPort()

std::string const & lsst::daf::persistence::DbStorageLocation::getPort ( void  ) const
virtual

Accessor for database port number.

Returns
Reference to database port number string.

Definition at line 122 of file DbStorageLocation.cc.

◆ getUsername()

std::string const & lsst::daf::persistence::DbStorageLocation::getUsername ( void  ) const
virtual

Accessor for username.

Returns
Reference to username string.

Definition at line 129 of file DbStorageLocation.cc.

◆ toString()

std::string lsst::daf::persistence::DbStorageLocation::toString ( void  ) const
virtual

Produce a string (URL) representation of the DbStorageLocation.

Returns
String suitable for constructing another DbStorageLocation

Definition at line 92 of file DbStorageLocation.cc.


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