00001 // 00002 // plumbing - C++ wrapper facades for Berkeley sockets 00003 // Copyright (C) 2009 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify it 00006 // under the terms of the GNU General Public License, version 3, as published 00007 // by the Free Software Foundation. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT 00010 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00012 // more details. 00013 // 00014 // You should have received a copy of the GNU General Public License along 00015 // with this program. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef LIBPLUMBING_ENDPOINT_CHARGEN_H 00019 #define LIBPLUMBING_ENDPOINT_CHARGEN_H 00020 00021 #include <boost/shared_ptr.hpp> 00022 #include <libplumbing/endpoint.h> 00023 00024 namespace plumbing { 00025 00030 class endpoint_chargen: 00031 public endpoint 00032 { 00033 public: 00037 virtual ~endpoint_chargen(); 00038 00039 private: 00048 endpoint_chargen(int fd); 00049 00050 public: 00061 static pointer create(int fd); 00062 00063 protected: 00064 // See base class for documentation. 00065 int get_write_file_descriptor(); 00066 00067 // See base class for documentation. 00068 void process_read(); 00069 00070 // See base class for documentation. 00071 void process_write(); 00072 00073 private: 00078 size_t sequence; 00079 00084 char data[74]; 00085 00090 size_t data_size; 00091 00096 size_t data_position; 00097 00101 endpoint_chargen(); 00102 00109 endpoint_chargen(const endpoint_chargen &rhs); 00110 00117 endpoint_chargen &operator=(const endpoint_chargen &rhs); 00118 }; 00119 00120 } 00121 00122 #endif // LIBPLUMBING_ENDPOINT_CHARGEN_H 00123 // vim: set ts=8 sw=4 et