FluteSender.h

Go to the documentation of this file.
00001 /*
00002  *   MAD-FLUTE-UNITTEST: FLUTE unit test.
00003  *   File: FluteSender.h
00004  *   Copyright (c) 2006-2007 M.B.I. www.mbigroup.it
00005  *   main authors/contacts: gmendola@mbigroup.it and lpoderico@mbigroup.it
00006  *
00007  *   This program is free software; you can redistribute it and/or modify
00008  *   it under the terms of the GNU General Public License as published by
00009  *   the Free Software Foundation; either version 2 of the License, or
00010  *   (at your option) any later version.
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
00018  *   along with this program; if not, write to the Free Software
00019  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  */
00021 
00022 #ifndef __FLUTESENDER__
00023 #define __FLUTESENDER__
00024 
00025 #include "TemporaryFile.h"
00026 
00027 #include <boost/thread/thread.hpp>
00028 
00029 #include <string>
00030 #include <list>
00031 #include <vector>
00032 
00033 class FluteSenderThread
00034 {
00035 public:
00036     FluteSenderThread(const std::string& aPath, int aBitRates);
00037 
00038     void addArgument(const std::string& anArgument);
00039 
00040     void operator() ();
00041 
00042     unsigned long long sessionSize();
00043 
00044 private:
00045     typedef std::list<std::string> TArguments;
00046     const std::string thePath;
00047     int theBitRates;
00048     TArguments theArguments;
00049 
00050     std::vector<const char*> theArgv;
00051 
00055     void getArgcArgv(int& anArgc, const char**& anArgv);
00056 
00060     void initArgument();
00061 };
00062 
00063 
00064 
00069 class FluteSender
00070 {
00071 public:
00072     FluteSender(const std::string& aPath, int aBitRates);
00073 
00074     ~FluteSender();
00075 
00076     void addArgument(const std::string& anArgument);
00077 
00078     unsigned long long sessionSize();
00079 
00080     void startSending();
00081 
00082 private:
00083     boost::thread* theThread;
00084     FluteSenderThread theFluteSenderThread;
00085 };
00086 
00087 #endif //__FLUTESENDER__

Generated on Fri Mar 9 19:59:55 2007 for MAD-FCL by  doxygen 1.5.0