Main Page | Compound List | File List | Compound Members | File Members

bytestream_env.cc

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #include <stdlib.h>
00012 #include <stdio.h>
00013 #include <string.h>
00014 #include "bytestream_env.h"
00015 
00016 byteStreamEnv::byteStreamEnv (
00017     const Id&               n,
00018     In<byteStream_args_t>&  febeArgsF,
00019     Out<VYAfileName>&       fileNameF,
00020     Out<int>&               nrBytesF
00021 )
00022 :
00023     // member initialization
00024     Process(n),
00025     febeArgsP(id("febeArgsP"),febeArgsF),
00026     fileNameP(id("fileNameP"),fileNameF),
00027     nrBytesP(id("nrBytesP"),nrBytesF)
00028 {}
00029 
00030 const char* byteStreamEnv::type() const
00031 {
00032     return "byteStreamEnv";
00033 }
00034 
00035 void byteStreamEnv::main()
00036 {
00037   while(true)
00038   { 
00039     VYAfileName       fileName;
00040     int               nrBytes;
00041     byteStream_args_t arguments;
00042 
00043     read(febeArgsP, arguments);
00044 
00045     if (getenv(arguments.path))
00046     {
00047       strcpy(fileName, getenv(arguments.path));
00048       strcat(fileName, "/");
00049       strcat(fileName, arguments.filename);
00050     }
00051     else
00052     {
00053       strcpy(fileName, arguments.filename);
00054     }
00055     nrBytes = arguments.nrofbytes;
00056 
00057     write(fileNameP, fileName);
00058     write(nrBytesP, nrBytes);
00059   }
00060 }

Generated on Wed Feb 15 14:52:43 2006 for bytestreamfebe by doxygen 1.3.2