SignatureSet.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef SIGNATURESET_H
00011 #define SIGNATURESET_H
00012 
00013 #include "Signature.h"
00014 
00015 #include <vector>
00016 
00017 /**
00018  *  A container for multiple signatures.
00019  *
00020  *  This class provides encapsulation for multiple signatures into a single object.  The
00021  *  SignatureSet is also a type of signature, so it can contain metadata, a description,
00022  *  and acquisition values.  Signatures can be inserted into and removed from the set.
00023  *
00024  *  When a SignatureSet is deleted, Signatures contained in the set are not automatically
00025  *  deleted unless the SignatureSet is an ancestor of the Signature.
00026  *
00027  *  This subclass of Subject will notify upon the following conditions:
00028  *  - The following methods are called: insertSignature(), removeSignature(),
00029  *    clearSignatures().
00030  *  - Everything else documented in Signature.
00031  *
00032  *  @see    Signature
00033  */
00034 class SignatureSet : public Signature
00035 {
00036 public:
00037    /**
00038     *  Adds an existing signature into the set.
00039     *
00040     *  @param   pSignature
00041     *           The signature to add to the set.
00042     *
00043     *  @return  TRUE if the signature was successfully added to the set, otherwise FALSE.
00044     *
00045     *  @notify  This method will notify Subject::signalModified.
00046     */
00047    virtual bool insertSignature(Signature* pSignature) = 0;
00048 
00049    /**
00050     *  Add several signatures to the set. It is possible to add the same sig
00051     *  to the set multiple times.
00052     *
00053     *  This method adds several sigs to the set. If any of the sigs to
00054     *  add are NULL, the method will fail, having done nothing. 
00055     *
00056     *  @param   signatures
00057     *           A vector of signatures to add to the set
00058     *
00059     *  @return  true if the signatures were added, otherwise false.
00060     *
00061     *  @notify  This method will notify Subject::signalModified after the 
00062     *           sigs are done being added to the list. Only one notification 
00063     *           will be done. No notification will be done if signatures is empty.
00064     */
00065    virtual bool insertSignatures(const std::vector<Signature*>& signatures) = 0;
00066 
00067    /**
00068     *  Checks to see if a signature is in the set.
00069     *
00070     *  @param   pSignature
00071     *           The signature to check for.
00072     *
00073     *  @return  true if the specified signature is in the set, otherwise false.
00074     */
00075    virtual bool hasSignature(Signature* pSignature) const = 0;
00076 
00077    /**
00078     *  Counts the signatures in the set.
00079     *
00080     *  @return  the number of signatures in the set.
00081     */
00082    virtual unsigned int getNumSignatures() const = 0;
00083 
00084    /**
00085     *  Returns a vector of pointers to the signatures in the set.
00086     *
00087     *  @return  The vector of signature pointers.
00088     */
00089    virtual std::vector<Signature*> getSignatures() const = 0;
00090 
00091    /**
00092     *  Removed a signature from the set.
00093     *
00094     *  @param   pSignature
00095     *           The signature to remove from the set.
00096     *
00097     *  @param   bDelete
00098     *           TRUE if the signature should be deleted when removed from the set,
00099     *           otherwise FALSE.
00100     *
00101     *  @return  TRUE if the signature successfully removed from the set, otherwise
00102     *           FALSE.  FALSE is also returned if the given signature does not exist
00103     *           in the set.
00104     *
00105     *  @notify  This method will notify Subject::signalModified.
00106     */
00107    virtual bool removeSignature(Signature* pSignature, bool bDelete = false) = 0;
00108 
00109    /**
00110     *  Removes several signatures from the set.
00111     *
00112     *  This method removes several sigs from the set, optionally deleting
00113     *  them in the process. If the list of sigs to remove contains sigs
00114     *  not in the set, those sigs will be ignored.
00115     *
00116     *  @param   signatures
00117     *           A vector of sigs to remove from the set
00118     *
00119     *  @param   bDelete
00120     *           Specifies if the signatures should be destroyed as well as being 
00121     *           removed from the set. Signatures not found in the set will
00122     *           not be deleted regardless of the value of this parameter.
00123     *
00124     *  @return  Returns \c true if the list of signatures to remove was not
00125     *           empty and all of the specified signatures were found in the
00126     *           set; otherwise returns \c false.
00127     *
00128     *  @notify  This method will notify Subject::signalModified after the 
00129     *           signatures are done being removed from the list. Only one 
00130     *           notification will be done.
00131     */
00132    virtual bool removeSignatures(const std::vector<Signature*>& signatures, bool bDelete = false) = 0;
00133 
00134    /**
00135     *  Removes all of the signatures from the set.
00136     *
00137     *  This method removes all of the signatures from the set, optionally deleting
00138     *  them in the process.
00139     *
00140     *  @param   bDelete
00141     *           Specifies if the signatures should be destroyed as well as being 
00142     *           removed from the set.
00143     *
00144     *  @notify  This method will notify Subject::signalModified after the signatures are
00145     *           done being removed from the set if the set was not empty.
00146     *           At most one notification will be done.
00147     */
00148    virtual void clear(bool bDelete = false) = 0;
00149 
00150 protected:
00151    /**
00152     * This should be destroyed by calling ModelServices::destroyElement.
00153     */
00154    virtual ~SignatureSet() {}
00155 };
00156 
00157 #endif

Software Development Kit - Opticks 4.9.0 Build 16218