00001 /********** 00002 This library is free software; you can redistribute it and/or modify it under 00003 the terms of the GNU Lesser General Public License as published by the 00004 Free Software Foundation; either version 2.1 of the License, or (at your 00005 option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) 00006 00007 This library is distributed in the hope that it will be useful, but WITHOUT 00008 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00009 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00010 more details. 00011 00012 You should have received a copy of the GNU Lesser General Public License 00013 along with this library; if not, write to the Free Software Foundation, Inc., 00014 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 **********/ 00016 // Copyright (c) 1996-2008 Live Networks, Inc. All rights reserved. 00017 // Basic Usage Environment: for a simple, non-scripted, console application 00018 // C++ header 00019 00020 #ifndef _BASIC_USAGE_ENVIRONMENT_HH 00021 #define _BASIC_USAGE_ENVIRONMENT_HH 00022 00023 #ifndef _BASIC_USAGE_ENVIRONMENT0_HH 00024 #include "BasicUsageEnvironment0.hh" 00025 #endif 00026 00027 class BasicUsageEnvironment: public BasicUsageEnvironment0 { 00028 public: 00029 static BasicUsageEnvironment* createNew(TaskScheduler& taskScheduler); 00030 00031 // redefined virtual functions: 00032 virtual int getErrno() const; 00033 00034 virtual UsageEnvironment& operator<<(char const* str); 00035 virtual UsageEnvironment& operator<<(int i); 00036 virtual UsageEnvironment& operator<<(unsigned u); 00037 virtual UsageEnvironment& operator<<(double d); 00038 virtual UsageEnvironment& operator<<(void* p); 00039 00040 protected: 00041 BasicUsageEnvironment(TaskScheduler& taskScheduler); 00042 // called only by "createNew()" (or subclass constructors) 00043 virtual ~BasicUsageEnvironment(); 00044 }; 00045 00046 00047 class BasicTaskScheduler: public BasicTaskScheduler0 { 00048 public: 00049 static BasicTaskScheduler* createNew(); 00050 virtual ~BasicTaskScheduler(); 00051 00052 protected: 00053 BasicTaskScheduler(); 00054 // called only by "createNew()" 00055 00056 protected: 00057 // Redefined virtual functions: 00058 virtual void SingleStep(unsigned maxDelayTime); 00059 00060 virtual void turnOnBackgroundReadHandling(int socketNum, 00061 BackgroundHandlerProc* handlerProc, 00062 void* clientData); 00063 virtual void turnOffBackgroundReadHandling(int socketNum); 00064 00065 protected: 00066 // To implement background reads: 00067 int fMaxNumSockets; 00068 fd_set fReadSet; 00069 }; 00070 00071 #endif
1.5.2