AMOS::Universal_t Class Reference

A universal base class that can be used by Banks or Messages. More...

#include <Universal_AMOS.hh>

Inheritance diagram for AMOS::Universal_t:

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

Public Member Functions

 Universal_t ()
 Constructs an empty Universal_t object.
 Universal_t (const Universal_t &source)
 Copy constructor.
virtual ~Universal_t ()
 Virtual destructor.
virtual void clear ()
 Clears all object data, reinitializes the object.
const std::string & getComment () const
 Get the comment string.
const Status_t getStatus () const
 Get the status value.
virtual NCode_t getNCode () const
 Get the AMOS NCode type identifier.
virtual void readMessage (const Message_t &msg)
 Reads in data from a Message object.
void setComment (const std::string &comment)
 Set the comment string.
void setStatus (Status_t status)
 Set the status value.
virtual void writeMessage (Message_t &msg) const
 Writes data to a Message object.
const std::string & getEID () const
 Get the external ID.
ID_t getIID () const
 Get the internal ID.
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.

Static Public Attributes

static const NCode_t NCODE = M_UNIVERSAL
 The NCode type identifier for this object.

Protected Member Functions

virtual void readRecord (std::istream &fix, std::istream &var)
 Read selected class members from a biserial record.
virtual void readRecordFix (std::istream &fix)
 Read selected class members from a fixed store only.
virtual void writeRecord (std::ostream &fix, std::ostream &var) const
 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"

Detailed Description

A universal base class that can be used by Banks or Messages.

All AMOS objects that can be read as Messages and stored in a Bank should be derived from this class. In addition, the single comment field in this class can be used for storage of any data that a type does not yet exist for, perhaps in XML format or similar.

Definition at line 34 of file Universal_AMOS.hh.


Constructor & Destructor Documentation

AMOS::Universal_t::Universal_t (  )  [inline]

Constructs an empty Universal_t object.

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

Definition at line 78 of file Universal_AMOS.hh.

References AMOS::NULL_STATUS.

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

Copy constructor.

Definition at line 87 of file Universal_AMOS.hh.

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

Virtual destructor.

Definition at line 96 of file Universal_AMOS.hh.


Member Function Documentation

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

Clears all object data, reinitializes the object.

Reimplemented from AMOS::IBankable_t.

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, and AMOS::Sequence_t.

Definition at line 103 of file Universal_AMOS.hh.

References AMOS::IBankable_t::clear(), and AMOS::NULL_STATUS.

Referenced by AMOS::Sequence_t::clear(), AMOS::Scaffold_t::clear(), AMOS::Overlap_t::clear(), AMOS::Link_t::clear(), AMOS::Library_t::clear(), AMOS::Layout_t::clear(), AMOS::Kmer_t::clear(), AMOS::Index_t::clear(), AMOS::Group_t::clear(), AMOS::Fragment_t::clear(), readMessage(), and writeMessage().

const std::string& AMOS::Universal_t::getComment (  )  const [inline]

Get the comment string.

Returns:
The comment string

Definition at line 116 of file Universal_AMOS.hh.

Referenced by AMOS::operator<<().

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

Get the external ID.

Returns:
The external ID

Definition at line 174 of file Bank_AMOS.hh.

References AMOS::IBankable_t::eid_m.

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

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

Get the internal ID.

Returns:
The internal ID

Definition at line 185 of file Bank_AMOS.hh.

References AMOS::IBankable_t::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::Universal_t::getNCode (  )  const [inline, virtual]

Get the AMOS NCode type identifier.

Returns:
The AMOS NCode type identifier

Implements AMOS::IBankable_t.

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, and AMOS::Sequence_t.

Definition at line 134 of file Universal_AMOS.hh.

References NCODE.

const Status_t AMOS::Universal_t::getStatus (  )  const [inline]

Get the status value.

Returns:
The status value

Definition at line 127 of file Universal_AMOS.hh.

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

Check the value of flag A.

Returns:
The value of flag A

Definition at line 228 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

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

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

Check the value of flag B.

Returns:
The value of flag B

Definition at line 239 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

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

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

Check if the object has been modified.

Returns:
true if modified, otherwise false

Definition at line 217 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

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

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 AMOS::IBankable_t::flags_m.

void Universal_t::readMessage ( const Message_t msg  )  [virtual]

Reads in data from a Message object.

Reads the data contained in a Message object and stores it in the Messagable object. Will not complain if incoming message is of the wrong type, will only try and suck out the fields it recognizes. All previous data in the Messagable object will be cleared or overwritten.

Parameters:
msg The Message to read from
Precondition:
The expected fields are formatted properly
Exceptions:
ArgumentException_t 
Returns:
void

Implements AMOS::IMessagable_t.

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, and AMOS::Sequence_t.

Definition at line 22 of file Universal_AMOS.cc.

References AMOS_THROW_ARGUMENT, clear(), AMOS::IBankable_t::eid_m, AMOS::F_COMMENT, AMOS::F_EID, AMOS::F_FLAG, AMOS::F_IID, AMOS::F_STATUS, AMOS::IBankable_t::iid_m, AMOS::IBankable_t::setFlagA(), AMOS::IBankable_t::setFlagB(), and setStatus().

Referenced by AMOS::Sequence_t::readMessage(), AMOS::Scaffold_t::readMessage(), AMOS::Overlap_t::readMessage(), AMOS::Link_t::readMessage(), AMOS::Library_t::readMessage(), AMOS::Layout_t::readMessage(), AMOS::Kmer_t::readMessage(), AMOS::Index_t::readMessage(), AMOS::Group_t::readMessage(), AMOS::Fragment_t::readMessage(), and AMOS::Feature_t::readMessage().

virtual void AMOS::Universal_t::readRecord ( std::istream &  fix,
std::istream &  var 
) [inline, protected, 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

Implements AMOS::IBankable_t.

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, and AMOS::Sequence_t.

Definition at line 46 of file Universal_AMOS.hh.

virtual void AMOS::Universal_t::readRecordFix ( std::istream &  fix  )  [inline, protected, 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

Implements AMOS::IBankable_t.

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, and AMOS::Sequence_t.

Definition at line 53 of file Universal_AMOS.hh.

void AMOS::Universal_t::setComment ( const std::string &  comment  )  [inline]

Set the comment string.

Parameters:
comment The new comment string
Returns:
void

Definition at line 150 of file Universal_AMOS.hh.

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

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 AMOS::IBankable_t::eid_m, and AMOS::NL_CHAR.

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

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 AMOS::IBankable_t::flags_m.

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

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

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 AMOS::IBankable_t::flags_m.

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

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

Set the internal ID.

Parameters:
iid The new internal ID
Returns:
void

Definition at line 300 of file Bank_AMOS.hh.

References AMOS::IBankable_t::iid_m.

void AMOS::Universal_t::setStatus ( Status_t  status  )  [inline]

Set the status value.

Parameters:
status The new status value
Returns:
void

Definition at line 162 of file Universal_AMOS.hh.

Referenced by readMessage().

void Universal_t::writeMessage ( Message_t msg  )  const [virtual]

Writes data to a Message object.

Writes the data contained in a Messagable object to a Message object. All previous data in the Message will be cleared or overwritten.

Parameters:
msg The Message to write to
Returns:
void

Implements AMOS::IMessagable_t.

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, and AMOS::Sequence_t.

Definition at line 72 of file Universal_AMOS.cc.

References clear(), AMOS::IBankable_t::eid_m, AMOS::F_COMMENT, AMOS::F_EID, AMOS::F_FLAG, AMOS::F_IID, AMOS::F_STATUS, AMOS::IBankable_t::iid_m, AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), NCODE, AMOS::NULL_ID, AMOS::NULL_STATUS, and AMOS::NULL_STRING.

Referenced by AMOS::Sequence_t::writeMessage(), AMOS::Scaffold_t::writeMessage(), AMOS::Overlap_t::writeMessage(), AMOS::Link_t::writeMessage(), AMOS::Library_t::writeMessage(), AMOS::Layout_t::writeMessage(), AMOS::Kmer_t::writeMessage(), AMOS::Index_t::writeMessage(), AMOS::Group_t::writeMessage(), AMOS::Fragment_t::writeMessage(), and AMOS::Feature_t::writeMessage().

virtual void AMOS::Universal_t::writeRecord ( std::ostream &  fix,
std::ostream &  var 
) const [inline, protected, 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

Implements AMOS::IBankable_t.

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, and AMOS::Sequence_t.

Definition at line 60 of file Universal_AMOS.hh.


Member Data Documentation

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

external ID (anything you want sans newlines)

Definition at line 66 of file Bank_AMOS.hh.

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

BankFlags_t AMOS::IBankable_t::flags_m [protected, inherited]

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(), AMOS::IBankable_t::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(), AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), AMOS::Overlap_t::isFlagC(), AMOS::IBankable_t::isModified(), AMOS::IBankable_t::isRemoved(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Bank_t::replaceBID(), AMOS::Overlap_t::setAdjacency(), AMOS::Link_t::setAdjacency(), AMOS::IBankable_t::setFlagA(), AMOS::IBankable_t::setFlagB(), AMOS::Overlap_t::setFlagC(), and AMOS::Sequence_t::uncompress().

ID_t AMOS::IBankable_t::iid_m [protected, inherited]

internal ID (integer AMOS identifier)

Definition at line 64 of file Bank_AMOS.hh.

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

const NCode_t Universal_t::NCODE = M_UNIVERSAL [static]

The NCode type identifier for this 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, and AMOS::Sequence_t.

Definition at line 70 of file Universal_AMOS.hh.

Referenced by getNCode(), and writeMessage().


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