Spm::Core::Branch Class Reference

A Branch (or version) of an Element. Version are noted Major.Minor.ActualVersion.extra. More...

#include <branch.h>

Inheritance diagram for Spm::Core::Branch:

Spm::Util::Object List of all members.

Public Member Functions

 Branch ()
 Branch (const Branch &)
 Branch (Element *aElement) throw (Util::NullPointerException)
 Branch (const std::string &aVersion, Element *aElement) throw (Util::NullPointerException, BadNameException)
 Branch (const std::string &aMajor, const std::string &aMinor, const std::string &extraVersion, Element *aElement)
 ~Branch ()
void setActual (const std::string &actual)
void setMinor (const std::string &aMinor)
void setMajor (const std::string &aMajor)
std::string getName ()
const std::string getMajor ()
const std::string getMinor ()
const std::string getActualVersion ()
const std::string getMajor () const
const std::string getMinor () const
const std::string getActualVersion () const
std::string getName () const
void setPrefix (const boost::filesystem::path &prefix)
void setFlags (const std::string &flags)
const boost::filesystem::path & getPrefix ()
const boost::filesystem::path & getPrefix () const
const std::string & getFlags ()
const std::string & getFlags () const
void setUrl (const std::string &url)
const std::string & getUrl ()
const std::string & getUrl () const
const std::map< std::string,
std::string > & 
getExtraInformations ()
const std::map< std::string,
std::string > & 
getExtraInformations () const
const std::string & getExtraInformation (const std::string &key) throw (UnknownKeyException)
const std::string & getExtraInformation (const std::string &key) const throw (UnknownKeyException)
void addExtraInformation (const std::string &key, const std::string &val) throw (AlreadyExistingKeyException)
void removeExtraInformation (const std::string &key) throw (UnknownKeyException)
void setExtraInformation (const std::map< std::string, std::string > &extra)
void setExtraInformation (const std::string &key, const std::string &val) throw (UnknownKeyException)
const std::string & getOwner ()
const std::string & getOwner () const
void setOwner (const std::string &aUser)
bool queryForFile (const boost::filesystem::path &file) const
 Check if a file belong to this Branch.
void setFiles (const std::list< boost::filesystem::path > &branchFiles)
const std::list< boost::filesystem::path > & getFiles ()
void setSize (unsigned long size)
const unsigned long & getSize ()
const unsigned long & getSize () const
void addElement (const Branch *branchOfElement)
 Add an Element.
void delElement (const std::string &elementName)
 remove an Element
const std::list< Branch * > & getElements ()
const std::list< Branch * > & getElements () const
const Branch * getElement (const std::string &elementName) throw (UnknownElementException)
 Get the Branch associated to an Element.
const Element * getElement ()
const Element * getElement () const
bool operator< (const Branch &b) const
bool operator< (const std::string &branchVersion)
bool operator== (const std::string &branchVersion)
bool operator== (const Branch &otherBranch) const

Static Public Member Functions

static std::string getBranchName (const std::string major, const std::string minor, const std::string micro)

Friends

class PackageSystem
class Element
class Store

Detailed Description

A Branch (or version) of an Element. Version are noted Major.Minor.ActualVersion.extra.

Note:
The elements member could have different meaning. If The Element associated with this Branch is a Package, This is the dependencys of the Package. If it's a Set, elements represents the Elements of the Set.


Constructor & Destructor Documentation

Spm::Core::Branch::Branch (   )  [inline]
 

Spm::Core::Branch::Branch (  const Branch &   )  [inline]
 

Spm::Core::Branch::Branch (  Element *  aElement  )  throw (Util::NullPointerException)
 

Parameters:
aElement the Element who own this Branch

Spm::Core::Branch::Branch (  const std::string &  aVersion,
Element *  aElement
)  throw (Util::NullPointerException, BadNameException)
 

Parameters:
aVersion the version of the branch for exemple 2.3.6
aElement the Element who own this Branch

Spm::Core::Branch::Branch (  const std::string &  aMajor,
const std::string &  aMinor,
const std::string &  extraVersion,
Element *  aElement
) 
 

Parameters:
aMajor The major number of the version
aMinor The minor number of the version
extraVersion The rest of the version
aElement the Element who own this Branch

Spm::Core::Branch::~Branch (   ) 
 


Member Function Documentation

void Spm::Core::Branch::addElement (  const Branch *  branchOfElement  ) 
 

Add an Element.

Parameters:
branchOfElement The Branch to add

void Spm::Core::Branch::addExtraInformation (  const std::string &  key,
const std::string &  val
)  throw (AlreadyExistingKeyException)
 

Parameters:
key The name of the information
val The value of the information

void Spm::Core::Branch::delElement (  const std::string &  elementName  ) 
 

remove an Element

Parameters:
elementName The name of the Element to remove

const std::string Spm::Core::Branch::getActualVersion (   )  const
 

const std::string Spm::Core::Branch::getActualVersion (   ) 
 

Returns:
The actual version number of the branch

static std::string Spm::Core::Branch::getBranchName (  const std::string  major,
const std::string  minor,
const std::string  micro
)  [static]
 

const Element* Spm::Core::Branch::getElement (   )  const
 

Returns:
The Element of the Branch

const Element* Spm::Core::Branch::getElement (   ) 
 

Returns:
The Element of the Branch

const Branch* Spm::Core::Branch::getElement (  const std::string &  elementName  )  throw (UnknownElementException)
 

Get the Branch associated to an Element.

Parameters:
elementName The name of the wanted Element
Returns:
the Branch associated

const std::list<Branch *>& Spm::Core::Branch::getElements (   )  const
 

const std::list<Branch *>& Spm::Core::Branch::getElements (   ) 
 

Returns:
Element of the branch

const std::string& Spm::Core::Branch::getExtraInformation (  const std::string &  key  )  const throw (UnknownKeyException)
 

const std::string& Spm::Core::Branch::getExtraInformation (  const std::string &  key  )  throw (UnknownKeyException)
 

Parameters:
key the name of the information
Returns:
the value of the founded information

const std::map<std::string, std::string>& Spm::Core::Branch::getExtraInformations (   )  const
 

const std::map<std::string, std::string>& Spm::Core::Branch::getExtraInformations (   ) 
 

Returns:
All extra information stored

const std::list<boost::filesystem::path>& Spm::Core::Branch::getFiles (   ) 
 

Returns:
The list of files of the Branch

const std::string& Spm::Core::Branch::getFlags (   )  const
 

const std::string& Spm::Core::Branch::getFlags (   ) 
 

Returns:
The Flags used for compilation

const std::string Spm::Core::Branch::getMajor (   )  const
 

const std::string Spm::Core::Branch::getMajor (   ) 
 

Returns:
The major number of the branch

const std::string Spm::Core::Branch::getMinor (   )  const
 

const std::string Spm::Core::Branch::getMinor (   ) 
 

Returns:
The minor number of the branch

std::string Spm::Core::Branch::getName (   )  const
 

Returns:
the full name of the branch (Major.Minor.ActualVersion)

Reimplemented from Spm::Util::Object.

std::string Spm::Core::Branch::getName (   ) 
 

Returns:
the full name of the branch (Major.Minor.ActualVersion)

Reimplemented from Spm::Util::Object.

const std::string& Spm::Core::Branch::getOwner (   )  const
 

Returns:
The name of the user who has installed the Branch

const std::string& Spm::Core::Branch::getOwner (   ) 
 

Returns:
The name of the user who has installed the Branch

const boost::filesystem::path& Spm::Core::Branch::getPrefix (   )  const
 

const boost::filesystem::path& Spm::Core::Branch::getPrefix (   ) 
 

Returns:
The prefix where the package is installed

const unsigned long& Spm::Core::Branch::getSize (   )  const
 

const unsigned long& Spm::Core::Branch::getSize (   ) 
 

Returns:
the size of the Branch

const std::string& Spm::Core::Branch::getUrl (   )  const
 

const std::string& Spm::Core::Branch::getUrl (   ) 
 

Returns:
The url of the branch

bool Spm::Core::Branch::operator< (  const std::string &  branchVersion  ) 
 

bool Spm::Core::Branch::operator< (  const Branch &  b  )  const
 

bool Spm::Core::Branch::operator== (  const Branch &  otherBranch  )  const
 

bool Spm::Core::Branch::operator== (  const std::string &  branchVersion  ) 
 

bool Spm::Core::Branch::queryForFile (  const boost::filesystem::path &  file  )  const
 

Check if a file belong to this Branch.

Parameters:
file the file to check
Returns:
true if the file belong to this Branch

void Spm::Core::Branch::removeExtraInformation (  const std::string &  key  )  throw (UnknownKeyException)
 

Parameters:
key The name of the information

void Spm::Core::Branch::setActual (  const std::string &  actual  ) 
 

Parameters:
actual the actual release of the branch

void Spm::Core::Branch::setExtraInformation (  const std::string &  key,
const std::string &  val
)  throw (UnknownKeyException)
 

Parameters:
key The name of the information
val The new value of the information

void Spm::Core::Branch::setExtraInformation (  const std::map< std::string, std::string > &  extra  ) 
 

Parameters:
extra The name and the new value of the extra information

void Spm::Core::Branch::setFiles (  const std::list< boost::filesystem::path > &  branchFiles  ) 
 

Parameters:
branchFiles the list of files of the Branch

void Spm::Core::Branch::setFlags (  const std::string &  flags  ) 
 

Parameters:
flags the Flags used for compilation

void Spm::Core::Branch::setMajor (  const std::string &  aMajor  ) 
 

Parameters:
aMajor the major number of the branch

void Spm::Core::Branch::setMinor (  const std::string &  aMinor  ) 
 

Parameters:
aMinor the minor number of the branch

void Spm::Core::Branch::setOwner (  const std::string &  aUser  ) 
 

Parameters:
aUser the name of the user who has installed the Branch

void Spm::Core::Branch::setPrefix (  const boost::filesystem::path &  prefix  ) 
 

Parameters:
prefix The prefix where the package is installed

void Spm::Core::Branch::setSize (  unsigned long  size  ) 
 

Parameters:
size the size of all file of the Branch

void Spm::Core::Branch::setUrl (  const std::string &  url  ) 
 

Parameters:
url The url of the branch


Friends And Related Function Documentation

friend class Element [friend]
 

friend class PackageSystem [friend]
 

friend class Store [friend]
 


The documentation for this class was generated from the following file:
Generated on Wed Jul 4 15:27:21 2007 for libSpm by  doxygen 1.4.6