Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::PhraseList Class Reference

A list of Phrases. More...

#include <PhraseList.h>

Inheritance diagram for TSE3::PhraseList:

Inheritance graph
[legend]
Collaboration diagram for TSE3::PhraseList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PhraseList ()
virtual ~PhraseList ()
size_t size () const
Phraseoperator[] (size_t n) const
Phrasephrase (const std::string &title) const
size_t index (const Phrase *phrase) const
void erase (Phrase *phrase)
void remove (Phrase *phrase)
void insert (Phrase *phrase)
std::string newPhraseTitle (const std::string &baseName=newPhraseString)
virtual void Phrase_TitleAltered (Phrase *)
virtual void Notifier_Deleted (Phrase *)
virtual void save (std::ostream &o, int i) const
virtual void load (std::istream &i, SerializableLoadInfo &info)

Static Public Attributes

const std::string newPhraseString
const std::string importedString
const std::string mergedPhraseString
const std::string explodedPhraseString

Friends

class Phrase

Detailed Description

A list of Phrases.

A list of within a certain Song.

Command classes
Use the following command classes to manipute this object in a undo/redo environment.

Author:
Pete Goodliffe
Version:
3.00
See also:
Phrase

Song


Constructor & Destructor Documentation

TSE3::PhraseList::PhraseList  ) 
 

Creates an empty PhraseList

virtual TSE3::PhraseList::~PhraseList  )  [virtual]
 

The destructor: all contained in the PhraseList will also be deleted.


Member Function Documentation

size_t TSE3::PhraseList::size  )  const [inline]
 

Returns the number of in the PhraseList.

Returns:
Number of

Phrase* TSE3::PhraseList::operator[] size_t  n  )  const [inline]
 

Returns the Phrase at positon n

The value returned for an index that is out of range is undefined. The size method describes the valid values.

Parameters:
n Index
Returns:
Phrase at index n

Phrase* TSE3::PhraseList::phrase const std::string &  title  )  const
 

Returns the Phrase with the given title.

Parameters:
title Unique Phrase reference title
Returns:
Phrase with given name

size_t TSE3::PhraseList::index const Phrase phrase  )  const
 

Returns the index of the given Phrase. If the Phrase is no in the PhraseList, returns the value of size().

Parameters:
phrase Phrase to search for
Returns:
index of in PhraseList, or size()

void TSE3::PhraseList::erase Phrase phrase  ) 
 

Deletes the Phrase (consequently removing it from the PhraseList). If the Phrase is not in the PhraseList no error is raised.

It is also safe to just delete a Phrase through a pointer to it. However, that's a little 'unconventional'.

Parameters:
phrase The Phrase to delete

void TSE3::PhraseList::remove Phrase phrase  ) 
 

Removes the Phrase from the PhraseList but does not delete it.

Note that this leaves you with a pretty useless Phrase. You cannot use it in a Part. Any Part objects that were using the Phrase will reset their Phrase reference.

The only way to make the Phrase useful again is to insert it back into a PhraseList.

Once you have removed a Phrase from the PhraseList it is no longer owned by the PhraseList, and it is your responsibility to delete it.

If the specified Phrase is not in the PhraseList then no error is raised.

Parameters:
phrase The Phrase to remove
See also:
insert

void TSE3::PhraseList::insert Phrase phrase  ) 
 

Inserts an unparented Phrase back into the PhraseList.

Throws if there is already a Phrase with that name in the PhraseList.

You cannot insert a Phrase with no title - the same exception will be thrown.

This causes the Phrase to be 'owned' by the PhraseList, it will be deleted when the PhraseList is deleted.

Parameters:
phrase The Phrase to insert
Exceptions:
PhraseListError 

std::string TSE3::PhraseList::newPhraseTitle const std::string &  baseName = newPhraseString  ) 
 

Returns a Phrase name based on the given base string that is guaranteed to not be used by any Phrase in this PhraseList.

If the base name already exists in the PhraseList, a unique variant of it will be returned (by appending a number).

Parameters:
baseName The base name string
Returns:
A new unused Phrase name string
See also:
newPhraseString

importedString

mergedPhraseString

explodedPhraseString

virtual void TSE3::PhraseList::Phrase_TitleAltered Phrase  )  [virtual]
 

Reimplemented from TSE3::PhraseListener.

virtual void TSE3::PhraseList::Notifier_Deleted Phrase  )  [virtual]
 

virtual void TSE3::PhraseList::save std::ostream &  o,
int  i
const [virtual]
 

Reimplemented from TSE3::Serializable.

virtual void TSE3::PhraseList::load std::istream &  i,
SerializableLoadInfo info
[virtual]
 

NOTE: The PhraseList actually loads the Phrase object chunks.

Reimplemented from TSE3::Serializable.


Friends And Related Function Documentation

friend class Phrase [friend]
 


Member Data Documentation

const std::string TSE3::PhraseList::newPhraseString [static]
 

The base name to use when creating a new Phrase.

See also:
newPhraseTitle

const std::string TSE3::PhraseList::importedString [static]
 

The base name to use when creating a new Phrase that has been imported.

See also:
newPhraseTitle

const std::string TSE3::PhraseList::mergedPhraseString [static]
 

The base name to use when creating a new Phrase that has been merged into the PhraseList.

See also:
newPhraseTitle

const std::string TSE3::PhraseList::explodedPhraseString [static]
 

The base name to use when creating a new Phrase that has been 'exploded' by a Phrase Utility.

See also:
newPhraseTitle


The documentation for this class was generated from the following file:
Generated on Wed May 25 14:46:50 2005 for TSE3 by doxygen 1.3.2