server/view.h

00001 
00002 /* Copyright (c) 2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQSERVER_VIEW_H
00019 #define EQSERVER_VIEW_H
00020 
00021 #include "paths.h"
00022 #include "viewVisitor.h"        // used in inline method
00023 #include "types.h"
00024 
00025 #include <eq/client/view.h>     // base class
00026 #include <eq/client/viewport.h> // member
00027 
00028 namespace eq
00029 {
00030 namespace server
00031 {
00032     class Config;
00033     class Layout;
00034 
00038     class View : public eq::View
00039     {
00040     public:
00041         EQSERVER_EXPORT View();
00042 
00044         View( const View& from, Config* config );
00045 
00046         virtual ~View();
00047 
00056         VisitorResult accept( ViewVisitor& visitor )
00057             { return visitor.visit( this ); }
00058         VisitorResult accept( ConstViewVisitor& visitor ) const
00059             { return visitor.visit( this ); }
00061         
00065         void setViewport( const Viewport& viewport );
00066 
00068         Config* getConfig();
00069 
00071         const Config* getConfig() const;
00072 
00074         Layout* getLayout() { return _layout; }
00075 
00077         const Layout* getLayout() const { return _layout; }
00078 
00080         ViewPath getPath() const;
00081 
00087         void addChannel( Channel* channel );
00088         
00096         bool removeChannel( Channel* channel );
00097         
00099         const ChannelVector& getChannels() const{ return _channels; }
00100 
00102         void setObserver( Observer* observer );
00104 
00105     protected:
00107         virtual void deserialize( net::DataIStream& is, 
00108                                   const uint64_t dirtyBits );
00109 
00110     private:
00111         virtual void getInstanceData( net::DataOStream& os );
00112 
00114         Layout* _layout;
00115         friend class Layout;
00116 
00118         ChannelVector _channels;
00119 
00120         union // placeholder for binary-compatible changes
00121         {
00122             char dummy[64];
00123         };
00124     };
00125 
00126     std::ostream& operator << ( std::ostream& os, const View* view );
00127 }
00128 }
00129 #endif // EQSERVER_VIEW_H
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8