00001 /* 00002 00003 Copyright 2007, 2008 Damian Stewart damian@frey.co.nz 00004 Distributed under the terms of the GNU Lesser General Public License v3 00005 00006 This file is part of the ofxOsc openFrameworks OSC addon. 00007 00008 ofxOsc is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU Lesser General Public License as published by 00010 the Free Software Foundation, either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 ofxOsc is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with ofxOsc. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef _OFXOSCBUNDLE_H 00023 #define _OFXOSCBUNDLE_H 00024 00025 #include <vector> 00026 #include "ofxOscMessage.h" 00027 00028 class ofxOscBundle 00029 { 00030 public: 00031 ofxOscBundle(); 00032 ~ofxOscBundle(); 00033 ofxOscBundle( const ofxOscBundle& other ) { copy ( other ); } 00034 ofxOscBundle& operator= ( const ofxOscBundle& other ) { return copy( other ); } 00036 ofxOscBundle& copy( const ofxOscBundle& other ); 00037 00039 void clear() { messages.clear(); bundles.clear(); } 00040 00042 void addBundle( const ofxOscBundle& element ); 00043 void addMessage( const ofxOscMessage& message ); 00044 00046 int getBundleCount() const { return bundles.size(); } 00047 int getMessageCount() const { return messages.size(); } 00049 ofxOscBundle& getBundleAt( int i ) { return bundles[i]; } 00050 ofxOscMessage& getMessageAt( int i ) { return messages[i]; } 00051 00052 private: 00053 00054 std::vector< ofxOscMessage > messages; 00055 std::vector< ofxOscBundle > bundles; 00056 }; 00057 00058 00059 #endif 00060