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

producer.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 "producer.h"
00012 #include <iostream>
00013 using namespace std;
00014 
00015 Producer::Producer(const Id& n, Out<int>& o) :
00016   Process(n),
00017   out( id("out"), o)
00018 { }
00019 
00020 const char* Producer::type() const
00021 {
00022   return "Producer";
00023 }
00024 
00025 void Producer::main()
00026 {
00027   cout << "Producer started" << endl;
00028 
00029   const int n = 1000;
00030 
00031   write(out, n);
00032 
00033   for (int i=0; i<n; i++)
00034   {
00035     write(out, i);
00036   }
00037 
00038   cout << type() << " " << fullName() << ": "
00039        << n << " values written" << endl;
00040 }

Generated on Wed Feb 15 14:52:42 2006 for pc by doxygen 1.3.2