Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | Related Pages

TScoreVisitor.h

00001 /*
00002   Copyright © Grame 2003
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) any later version.
00008     
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Lesser General Public License for more details.
00013     
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this library; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018     Grame Research Laboratory, 9, rue du Garet 69001 Lyon - France
00019     grame@grame.fr
00020 
00021 */
00022 
00023 #ifndef __TScoreVisitor__
00024 #define __TScoreVisitor__
00025 
00026 #include <vector>
00027 #include "smartclasses.h"
00028 #include "smartpointer.h"
00029 
00030 using namespace std;
00031 
00032 namespace MusicXML 
00033 {
00046 class TScoreVisitor : public smartable {
00047 
00048     public:
00049         TScoreVisitor() {}
00050         virtual ~TScoreVisitor() {}
00051 
00052         virtual void visite ( SAccidental& elt ) {}
00053         virtual void visite ( SArticulationElement& elt ) {}
00054         virtual void visite ( SArticulations& elt ) {}
00055         virtual void visite ( SAttributes& elt ) {}
00056         virtual void visite ( SBackup& elt ) {}
00057         virtual void visite ( SBarline& elt ) {}
00058         virtual void visite ( SBeam& elt ) {}
00059         virtual void visite ( SBracket& elt ) {}
00060         virtual void visite ( SChord& elt ) {}
00061         virtual void visite ( SClef& elt ) {}
00062         virtual void visite ( SCoda& elt ) {}
00063         virtual void visite ( SCreator& elt ) {}
00064         virtual void visite ( SDashes& elt ) {}
00065         virtual void visite ( SDirection& elt ) {}
00066         virtual void visite ( SDirectionType& elt ) {}
00067         virtual void visite ( SDirective& elt ) {}
00068         virtual void visite ( SDynamic& elt ) {}
00069         virtual void visite ( SEncoding& elt ) {}
00070         virtual void visite ( SEnding& elt ) {}
00071         virtual void visite ( SExpression& elt ) {}
00072         virtual void visite ( SFermata& elt ) {}
00073         virtual void visite ( SForward& elt ) {}
00074         virtual void visite ( SGraceNote& elt ) {}
00075         virtual void visite ( SGraphNote& elt ) {}
00076         virtual void visite ( SIdentification& elt ) {}
00077         virtual void visite ( SKey& elt ) {}
00078         virtual void visite ( SMeasure& elt ) {}
00079         virtual void visite ( SMetronome& elt ) {}
00080         virtual void visite ( SMidiDevice& elt ) {}
00081         virtual void visite ( SMidiInstrument& elt ) {}
00082         virtual void visite ( SNotation& elt ) {}
00083         virtual void visite ( SNote& elt ) {}
00084         virtual void visite ( SNoteHead& elt ) {}
00085         virtual void visite ( SOctaveShift& elt ) {}
00086         virtual void visite ( SPWMeasure& elt ) {}
00087         virtual void visite ( SPWPart& elt ) {}
00088         virtual void visite ( SPart& elt ) {}
00089         virtual void visite ( SPartGroup& elt ) {}
00090         virtual void visite ( SPartList& elt ) {}
00091         virtual void visite ( SPitch& elt ) {}
00092         virtual void visite ( SRepeat& elt ) {}
00093         virtual void visite ( SRest& elt ) {}
00094         virtual void visite ( SRights& elt ) {}
00095         virtual void visite ( SScoreHeader& elt ) {}
00096         virtual void visite ( SScoreInstrument& elt ) {}
00097         virtual void visite ( SScorePart& elt ) {}
00098         virtual void visite ( SScorePartwise& elt ) {}
00099         virtual void visite ( SScoreTimewise& elt ) {}
00100         virtual void visite ( SSegno& elt ) {}
00101         virtual void visite ( SSlur& elt ) {}
00102         virtual void visite ( SSound& elt ) {}
00103         virtual void visite ( SStrongAccent& elt ) {}
00104         virtual void visite ( STWMeasure& elt ) {}
00105         virtual void visite ( STWPart& elt ) {}
00106         virtual void visite ( STie& elt ) {}
00107 //      virtual void visite ( STieSlur& elt ) {}
00108         virtual void visite ( STimeModification& elt ) {}
00109         virtual void visite ( STimeSign& elt ) {}
00110         virtual void visite ( STranspose& elt ) {}
00111 //      virtual void visite ( STrill& elt ) {}
00112         virtual void visite ( STuplet& elt ) {}
00113         virtual void visite ( STupletDesc& elt ) {}
00114         virtual void visite ( SUnpitched& elt ) {}
00115         virtual void visite ( SWavyLine& elt ) {}
00116         virtual void visite ( SWedge& elt ) {}
00117         virtual void visite ( SWords& elt ) {}
00118         virtual void visite ( SWork& elt ) {}
00119 
00120         virtual void visite ( TOrientation* elt ) {}
00121         virtual void visite ( TPlacement* elt ) {}
00122         virtual void visite ( TPosition* elt ) {}
00123 
00124 };
00125 
00129 class visitable {
00130     public:
00131         virtual void accept(TScoreVisitor& visitor) = 0;
00132 };
00133 typedef SMARTP<visitable> Svisitable;
00134 
00140 template <typename T> 
00141 class vvector: public vector<T>, public visitable {
00142     
00143     public:
00144         vvector() {}
00145         virtual~ vvector(){}
00146     
00147         void accept(TScoreVisitor& visitor) {
00148             typename vector<T>::iterator iter;
00149             for (iter = begin(); iter != end(); iter++) 
00150                 (*iter)->accept(visitor);
00151         }
00152 };
00153 
00157 } // namespace MusicXML
00158 
00159 
00160 #endif

Generated on Tue Mar 23 09:49:44 2004 for LibMusicXML by doxygen 1.3.3