Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

aflibChain.h

Go to the documentation of this file.
00001 /*
00002  * Copyright: (C) 1999-2001 Bruce W. Forsberg
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 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  *   Bruce Forsberg  forsberg@tns.net
00019  *
00020  */
00021 
00022 
00023 #ifndef _AFLIBCHAIN_H
00024 #define _AFLIBCHAIN_H
00025 
00026 #include <list>
00027 #include <map>
00028 #include "aflib.h"
00029 #if __GNUC__ >= 3
00030 using std::list;
00031 using std::map;
00032 #include <function.h>
00033 #endif
00034 
00053 class aflibAudio;
00054 class aflibChainNode;
00055 
00056 
00057 class aflibChain {
00058 
00059 public:
00060 
00061    virtual
00062    ~aflibChain();
00063 
00064    const map<int, aflibAudio *, less<int> >&
00065    getParents() const;
00066 
00067    int
00068    addParent(aflibAudio& parent);
00069 
00070    void
00071    removeParent(int parent_id);
00072 
00073    void
00074    removeParent(aflibAudio& parent);
00075 
00076    bool
00077    getNodeProcessed() const;
00078  
00079    void
00080    setNodeProcessed(bool node);
00081 
00082    void
00083    dumpChain(bool check_env = TRUE);
00084 
00085 protected:
00086 
00087    aflibChain();
00088    aflibChain(aflibAudio& parent);
00089 
00090    void
00091    replaceParent(
00092       aflibAudio& old_p,
00093       aflibAudio& new_p);
00094 
00095    // These are callback functions that derived classes can over ride to be
00096    // notified when a parent is destroyed or added. An Audio Editor object
00097    // for instance may have many inputs and if one is destroyed then it needs to
00098    // be notified so that it can rebuild its lists.
00099    virtual void
00100    parentWasDestroyed(int parent_id);
00101 
00102    virtual void
00103    parentWasAdded(int parent_id);
00104 
00105 private:
00106 
00107    aflibChain(aflibChain& op);
00108 
00109    const aflibChain&
00110    operator=(const aflibChain& op);
00111 
00112    void
00113    insertIntoChain(
00114       aflibAudio& parent,
00115       aflibAudio& child);
00116 
00117    void
00118    insertIntoChain(
00119       aflibAudio& child);
00120 
00121    void
00122    removeFromChain(
00123       aflibAudio& child);
00124 
00125 
00126 static list<aflibChainNode *>  _total_list;  
00127 aflibChainNode *   _this_node;
00128 bool               _processing_constructor;
00129 
00130 };
00131 
00132 
00133 #endif
00134 
00135 

Generated at Tue Aug 7 22:18:05 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001