AMOS::IBankable_t Class Reference

Interface for classes that can be stored in an AMOS bank. More...

#include <Bank_AMOS.hh>

Inheritance diagram for AMOS::IBankable_t:

[legend]
Collaboration diagram for AMOS::IBankable_t:
[legend]
List of all members.

Public Member Functions

 IBankable_t ()
 Constructs an empty IBankable_t object.
 IBankable_t (const IBankable_t &source)
 Copy constructor.
virtual ~IBankable_t ()
 Virtual destructor.
virtual void clear ()
 Clears all object data, reinitializes the object.
const std::string & getEID () const
 Get the external ID.
ID_t getIID () const
 Get the internal ID.
virtual NCode_t getNCode () const =0
 Get the AMOS NCode type identifier.
bool isRemoved () const
 Check if the object is waiting to be removed from the bank.
bool isModified () const
 Check if the object has been modified.
bool isFlagA () const
 Check the value of flag A.
bool isFlagB () const
 Check the value of flag B.
void setEID (const std::string &eid)
 Set the external ID.
void setFlagA (bool flag)
 Set flag A.
void setFlagB (bool flag)
 Set flag B.
void setIID (ID_t iid)
 Set the internal ID.

Protected Member Functions

virtual void readRecord (std::istream &fix, std::istream &var)=0
 Read selected class members from a biserial record.
virtual void readRecordFix (std::istream &fix)=0
 Read selected class members from a fixed store only.
virtual void writeRecord (std::ostream &fix, std::ostream &var) const =0
 Write selected class members to a biserial record.

Protected Attributes

ID_t iid_m
 internal ID (integer AMOS identifier)
std::string eid_m
 external ID (anything you want sans newlines)
BankFlags_t flags_m
 bank flags, derived classes may use "nibble"

Friends

class Bank_t
 so the bank class can use the read/writes
class BankStream_t
 so the bank class can use the read/writes

Detailed Description

Interface for classes that can be stored in an AMOS bank.

All classes derived from this interface class may be stored in a AMOS bank. Derived classes from this type that you wish to include in an AMOS Bank_t. This will assure all data types being "banked" will have an iid, eid and flags field, and will be able to read and write themselves to a bank. To derive new types, the developer must implement the virtual functions to ensure the new class can be correctly stored and recovered from a bank. Each IBankable class should return a unique (static) NCode when getNCode is called upon, so that the bank dynamically identify the types of virtual objects.

Definition at line 56 of file Bank_AMOS.hh.


Constructor & Destructor Documentation

AMOS::IBankable_t::IBankable_t (  )  [inline]

Constructs an empty IBankable_t object.

Set IID to NULL_ID, comment to empty string and all flags to false.

Definition at line 134 of file Bank_AMOS.hh.

References iid_m, and AMOS::NULL_ID.

AMOS::IBankable_t::IBankable_t ( const IBankable_t source  )  [inline]

Copy constructor.

Definition at line 143 of file Bank_AMOS.hh.

virtual AMOS::IBankable_t::~IBankable_t (  )  [inline, virtual]

Virtual destructor.

Definition at line 152 of file Bank_AMOS.hh.


Member Function Documentation

virtual void AMOS::IBankable_t::clear (  )  [inline, virtual]

Clears all object data, reinitializes the object.

Reimplemented in AMOS::Contig_t, AMOS::ContigEdge_t, AMOS::ContigLink_t, AMOS::Edge_t, AMOS::Feature_t, AMOS::Fragment_t, AMOS::Group_t, AMOS::Index_t, AMOS::Kmer_t, AMOS::Layout_t, AMOS::Library_t, AMOS::Link_t, AMOS::Overlap_t, AMOS::Read_t, AMOS::Scaffold_t, AMOS::ScaffoldEdge_t, AMOS::ScaffoldLink_t, AMOS::Sequence_t, and AMOS::Universal_t.

Definition at line 161 of file Bank_AMOS.hh.

References eid_m, flags_m, iid_m, and AMOS::NULL_ID.

Referenced by AMOS::Universal_t::clear().

const std::string& AMOS::IBankable_t::getEID (  )  const [inline]

Get the external ID.

Returns:
The external ID

Definition at line 174 of file Bank_AMOS.hh.

References eid_m.

Referenced by AMOS::TiledRead_t::TiledRead_t().

ID_t AMOS::IBankable_t::getIID (  )  const [inline]

Get the internal ID.

Returns:
The internal ID

Definition at line 185 of file Bank_AMOS.hh.

References iid_m.

Referenced by AMOS::Index_t::buildContigFeature(), AMOS::Index_t::buildContigScaffold(), AMOS::Index_t::buildReadContig(), AMOS::Index_t::buildReadLibrary(), AMOS::Index_t::buildScaffoldFeature(), and AMOS::operator<<().

virtual NCode_t AMOS::IBankable_t::getNCode (  )  const [pure virtual]

Get the AMOS NCode type identifier.

Returns:
The AMOS NCode type identifier

Implemented in AMOS::Contig_t, AMOS::ContigEdge_t, AMOS::ContigLink_t, AMOS::Edge_t, AMOS::Feature_t, AMOS::Fragment_t, AMOS::Group_t, AMOS::Index_t, AMOS::Kmer_t, AMOS::Layout_t, AMOS::Library_t, AMOS::Link_t, AMOS::Overlap_t, AMOS::Read_t, AMOS::Scaffold_t, AMOS::ScaffoldEdge_t, AMOS::ScaffoldLink_t, AMOS::Sequence_t, and AMOS::Universal_t.

Referenced by AMOS::Bank_t::appendBID(), AMOS::Bank_t::fetchBID(), AMOS::Bank_t::fetchBIDFix(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), and AMOS::Bank_t::replaceBID().

bool AMOS::IBankable_t::isFlagA (  )  const [inline]

Check the value of flag A.

Returns:
The value of flag A

Definition at line 228 of file Bank_AMOS.hh.

References flags_m.

Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage().

bool AMOS::IBankable_t::isFlagB (  )  const [inline]

Check the value of flag B.

Returns:
The value of flag B

Definition at line 239 of file Bank_AMOS.hh.

References flags_m.

Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage().

bool AMOS::IBankable_t::isModified (  )  const [inline]

Check if the object has been modified.

Returns:
true if modified, otherwise false

Definition at line 217 of file Bank_AMOS.hh.

References flags_m.

bool AMOS::IBankable_t::isRemoved (  )  const [inline]

Check if the object is waiting to be removed from the bank.

Note:
Useful for debugging only
Returns:
true if removed, otherwise false

Definition at line 206 of file Bank_AMOS.hh.

References flags_m.

virtual void AMOS::IBankable_t::readRecord ( std::istream &  fix,
std::istream &  var 
) [protected, pure virtual]

Read selected class members from a biserial record.

Reads the fixed and variable length streams from a biserial record and initializes the class members to the values stored within. Used in translating a biserial IBankable object, and needed to retrieve objects from a bank.

Note:
This method must be able to interpret the biserial record produced by its related function writeRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
var The variable length stream (stores all var length members)
Precondition:
The get pointer of fix is at the beginning of the record

The get pointer of var is at the beginning of the record

Returns:
void

Implemented in AMOS::Contig_t, AMOS::ContigEdge_t, AMOS::ContigLink_t, AMOS::Edge_t, AMOS::Feature_t, AMOS::Fragment_t, AMOS::Group_t, AMOS::Index_t, AMOS::Kmer_t, AMOS::Layout_t, AMOS::Library_t, AMOS::Link_t, AMOS::Overlap_t, AMOS::Read_t, AMOS::Scaffold_t, AMOS::ScaffoldEdge_t, AMOS::ScaffoldLink_t, AMOS::Sequence_t, and AMOS::Universal_t.

Referenced by AMOS::Bank_t::fetchBID(), and AMOS::BankStream_t::operator>>().

virtual void AMOS::IBankable_t::readRecordFix ( std::istream &  fix  )  [protected, pure virtual]

Read selected class members from a fixed store only.

Reads the fixed stream and initializes the class members to the values stored within. Used to fetch the fixed portion of a biserial IBankable object, and needed to retrieve objects from a bank.

Note:
This method must be able to interpret the biserial record produced by its related function writeRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
Precondition:
The get pointer of fix is at the beginning of the record
Returns:
void

Implemented in AMOS::Contig_t, AMOS::ContigEdge_t, AMOS::ContigLink_t, AMOS::Edge_t, AMOS::Feature_t, AMOS::Fragment_t, AMOS::Group_t, AMOS::Index_t, AMOS::Kmer_t, AMOS::Layout_t, AMOS::Library_t, AMOS::Link_t, AMOS::Overlap_t, AMOS::Read_t, AMOS::Scaffold_t, AMOS::ScaffoldEdge_t, AMOS::ScaffoldLink_t, AMOS::Sequence_t, and AMOS::Universal_t.

Referenced by AMOS::Bank_t::fetchBIDFix(), and AMOS::BankStream_t::operator>>().

void AMOS::IBankable_t::setEID ( const std::string &  eid  )  [inline]

Set the external ID.

Will only use the characters up to but not including the first newline.

Returns:
void

Definition at line 252 of file Bank_AMOS.hh.

References eid_m, and AMOS::NL_CHAR.

void AMOS::IBankable_t::setFlagA ( bool  flag  )  [inline]

Set flag A.

Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag B.

Parameters:
flag The new flag A value
Returns:
void

Definition at line 272 of file Bank_AMOS.hh.

References flags_m.

Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage().

void AMOS::IBankable_t::setFlagB ( bool  flag  )  [inline]

Set flag B.

Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag A.

Parameters:
flag The new flag B value
Returns:
void

Definition at line 288 of file Bank_AMOS.hh.

References flags_m.

Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage().

void AMOS::IBankable_t::setIID ( ID_t  iid  )  [inline]

Set the internal ID.

Parameters:
iid The new internal ID
Returns:
void

Definition at line 300 of file Bank_AMOS.hh.

References iid_m.

virtual void AMOS::IBankable_t::writeRecord ( std::ostream &  fix,
std::ostream &  var 
) const [protected, pure virtual]

Write selected class members to a biserial record.

Writes the fixed and variable length streams to a biserial record. Used in generating a biserial IBankable object, and needed to commit objects to a bank. Should not write the flags, EID, or IID of the object because the bank will handle the storage of these fields on its own.

Note:
This method must be able to produce a biserial record that can be read by its related funtion readRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
var The variable length stream (stores all var length members)
Returns:
void

Implemented in AMOS::Contig_t, AMOS::ContigEdge_t, AMOS::ContigLink_t, AMOS::Edge_t, AMOS::Feature_t, AMOS::Fragment_t, AMOS::Group_t, AMOS::Index_t, AMOS::Kmer_t, AMOS::Layout_t, AMOS::Library_t, AMOS::Link_t, AMOS::Overlap_t, AMOS::Read_t, AMOS::Scaffold_t, AMOS::ScaffoldEdge_t, AMOS::ScaffoldLink_t, AMOS::Sequence_t, and AMOS::Universal_t.

Referenced by AMOS::Bank_t::appendBID(), AMOS::BankStream_t::operator<<(), and AMOS::Bank_t::replaceBID().


Friends And Related Function Documentation

friend class Bank_t [friend]

so the bank class can use the read/writes

Definition at line 58 of file Bank_AMOS.hh.

friend class BankStream_t [friend]

so the bank class can use the read/writes

Definition at line 59 of file Bank_AMOS.hh.


Member Data Documentation

std::string AMOS::IBankable_t::eid_m [protected]

external ID (anything you want sans newlines)

Definition at line 66 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::append(), clear(), getEID(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Universal_t::readMessage(), AMOS::BankStream_t::replace(), AMOS::Bank_t::replace(), AMOS::BankStream_t::replaceByBID(), setEID(), and AMOS::Universal_t::writeMessage().

BankFlags_t AMOS::IBankable_t::flags_m [protected]

bank flags, derived classes may use "nibble"

Definition at line 68 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::appendBID(), AMOS::Sequence_t::clear(), clear(), AMOS::Sequence_t::compress(), AMOS::Bank_t::fetchBID(), AMOS::Bank_t::fetchBIDFix(), AMOS::Overlap_t::getAdjacency(), AMOS::Link_t::getAdjacency(), AMOS::Sequence_t::isCompressed(), isFlagA(), isFlagB(), AMOS::Overlap_t::isFlagC(), isModified(), isRemoved(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Bank_t::replaceBID(), AMOS::Overlap_t::setAdjacency(), AMOS::Link_t::setAdjacency(), setFlagA(), setFlagB(), AMOS::Overlap_t::setFlagC(), and AMOS::Sequence_t::uncompress().

ID_t AMOS::IBankable_t::iid_m [protected]

internal ID (integer AMOS identifier)

Definition at line 64 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::append(), clear(), getIID(), IBankable_t(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Universal_t::readMessage(), AMOS::BankStream_t::replace(), AMOS::Bank_t::replace(), AMOS::BankStream_t::replaceByBID(), setIID(), and AMOS::Universal_t::writeMessage().


The documentation for this class was generated from the following file:
Generated on Mon Feb 22 17:36:34 2010 for libAMOS by  doxygen 1.4.7