libStatGen Software 1
SamHeaderPG Class Reference
Inheritance diagram for SamHeaderPG:
Collaboration diagram for SamHeaderPG:

Public Member Functions

virtual SamHeaderRecordcreateCopy () const
 Return a pointer to a newly created header record of the appropriate type that is a copy of this record. More...
 
- Public Member Functions inherited from SamHeaderRecord
 SamHeaderRecord ()
 Constructor. More...
 
virtual ~SamHeaderRecord ()
 Destructor. More...
 
virtual SamHeaderRecordcreateCopy () const =0
 Return a pointer to a newly created header record of the appropriate type that is a copy of this record. More...
 
bool setFields (const StringArray &tokens)
 Set the fields from the passed in line. More...
 
bool isValid ()
 Check to see if the record is valid. More...
 
const char * getTagValue (const char *tag) const
 Return the value associated with the specified tag. More...
 
bool setTag (const char *tag, const char *value)
 Set the value of the specified tag to the specified value, deletes the tag when value is NULL. More...
 
void reset ()
 Reset this header record to an empty state with no tags. More...
 
bool appendString (std::string &header)
 Appends the string representation of this header record to the passed in string. More...
 
bool addKey (const char *value)
 Add the key tag with the specified value (not for HD headers). More...
 
const char * getKeyValue () const
 Get the value associated with the key tag. Returns "" if it is not set. More...
 
bool isActiveHeaderRecord ()
 This record is active (true) if there is at least one tag set. More...
 
const char * getTypeString ()
 Return the type of this header record (HD, SQ, RG, or PG) as a string. More...
 
SamHeaderRecordType getType ()
 Return the type of this header record (HD, SQ, RG, or PG) as an enum. More...
 

Additional Inherited Members

- Public Types inherited from SamHeaderRecord
enum  SamHeaderRecordType { HD , SQ , RG , PG }
 Specifies the Type for the sam header record (line). More...
 
- Protected Member Functions inherited from SamHeaderRecord
void addRequiredTag (const char *requiredTag)
 
virtual void internalCopy (SamHeaderRecord &newRec) const
 
- Protected Attributes inherited from SamHeaderRecord
std::string myTypeString
 
SamHeaderRecordType myType
 
std::string myKeyTag
 

Detailed Description

Definition at line 24 of file SamHeaderPG.h.

Constructor & Destructor Documentation

◆ SamHeaderPG()

SamHeaderPG::SamHeaderPG ( )

Definition at line 21 of file SamHeaderPG.cpp.

22{
23 // Add required tags for this type.
24 myType = SamHeaderRecord::PG;
25 myTypeString = "PG";
26 addRequiredTag("ID");
27 myKeyTag = "ID";
28}

◆ ~SamHeaderPG()

SamHeaderPG::~SamHeaderPG ( )
virtual

Definition at line 32 of file SamHeaderPG.cpp.

33{
34}

Member Function Documentation

◆ createCopy()

SamHeaderRecord * SamHeaderPG::createCopy ( ) const
virtual

Return a pointer to a newly created header record of the appropriate type that is a copy of this record.

The newly created record will not be deleted by this class and it is the responsibility of the calling method to handle the deletion. Returns NULL on failure to copy.

Implements SamHeaderRecord.

Definition at line 37 of file SamHeaderPG.cpp.

38{
39 SamHeaderPG* newPG = new SamHeaderPG();
40 if(newPG == NULL)
41 {
42 std::cerr << "Failed to create a copy of an PG Header Record\n" ;
43 return(NULL);
44 }
45 internalCopy(*newPG);
46
47 return(newPG);
48}

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