• Main Page
  • Classes
  • Files
  • File List

/Users/yzchen/ns/ns-allinone-2.33/ns-2.33/diffusion3/apps/rmst_examples/rmst_sink.hh

00001 //
00002 // rmst_sink.hh    : RmstSink Class
00003 // authors         : Fred Stann
00004 //
00005 // Copyright (C) 2003 by the University of Southern California
00006 // $Id: rmst_sink.hh,v 1.3 2005/09/13 04:53:47 tomh Exp $
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License,
00010 // version 2, as published by the Free Software Foundation.
00011 //
00012 // This program is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License along
00018 // with this program; if not, write to the Free Software Foundation, Inc.,
00019 // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00020 // 
00021 // Linking this file statically or dynamically with other modules is making
00022 // a combined work based on this file.  Thus, the terms and conditions of
00023 // the GNU General Public License cover the whole combination.
00024 //
00025 // In addition, as a special exception, the copyright holders of this file
00026 // give you permission to combine this file with free software programs or
00027 // libraries that are released under the GNU LGPL and with code included in
00028 // the standard release of ns-2 under the Apache 2.0 license or under
00029 // otherwise-compatible licenses with advertising requirements (or modified
00030 // versions of such code, with unchanged license).  You may copy and
00031 // distribute such a system following the terms of the GNU GPL for this
00032 // file and the licenses of the other code concerned, provided that you
00033 // include the source code of that other code when and as the GNU GPL
00034 // requires distribution of source code.
00035 //
00036 // Note that people who make modified versions of this file are not
00037 // obligated to grant this special exception for their modified versions;
00038 // it is their choice whether to do so.  The GNU General Public License
00039 // gives permission to release a modified version without this exception;
00040 // this exception also makes it possible to release a modified version
00041 // which carries forward this exception.
00042 //
00043 
00044 #ifndef RMST_SNK
00045 #define RMST_SNK
00046 
00047 #ifdef HAVE_CONFIG_H
00048 #include "config.h"
00049 #endif
00050 
00051 #include "diffapp.hh"
00052 
00053 class RmstSink;
00054 
00055 class RmstSnkReceive : public NR::Callback {
00056 public:
00057   RmstSnkReceive(RmstSink *rmstSnk) { snk_ = rmstSnk; }
00058   void recv(NRAttrVec *data, NR::handle my_handle);
00059 protected:
00060   RmstSink *snk_; 
00061 };
00062 
00063 class RmstSink : public DiffApp {
00064 public:
00065 #ifdef NS_DIFFUSION
00066   RmstSink();
00067   int command(int argc, const char*const* argv);
00068 #else
00069   RmstSink(int argc, char **argv);
00070 #endif // NS_DIFFUSION
00071 
00072   virtual ~RmstSink(){};
00073   handle setupInterest();
00074   void run();
00075   void createAttrTemplates();
00076   void recv(void *blob, int size);
00077   NR* getDr() {return dr_;}
00078   handle rmst_handle_;         // PCM Sample interest
00079 private:
00080   RmstSnkReceive *mr;
00081   int blobs_to_rec_;
00082   int no_rec_;
00083 };
00084 
00085 #endif // RMST_SNK

Generated on Tue Aug 10 2010 16:16:06 for ns-2.33 by  doxygen 1.7.1