--- /dev/null
+/*****************************************************************************\r
+\r
+$Id$\r
+\r
+File: files.h\r
+Date: 26Aug06\r
+\r
+Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.\r
+Gmail: blackhedd\r
+\r
+This program is free software; you can redistribute it and/or modify\r
+it under the terms of either: 1) the GNU General Public License\r
+as published by the Free Software Foundation; either version 2 of the\r
+License, or (at your option) any later version; or 2) Ruby's License.\r
+\r
+See the file COPYING for complete licensing information.\r
+\r
+*****************************************************************************/\r
+\r
+\r
+#ifndef __FileStreamDescriptor__H_\r
+#define __FileStreamDescriptor__H_\r
+\r
+\r
+\r
+/**************************\r
+class FileStreamDescriptor\r
+**************************/\r
+\r
+class FileStreamDescriptor: public EventableDescriptor\r
+{\r
+ public:\r
+ FileStreamDescriptor (int, EventMachine_t*);\r
+ virtual ~FileStreamDescriptor();\r
+\r
+ virtual void Read();\r
+ virtual void Write();\r
+ virtual void Heartbeat();\r
+\r
+ virtual bool SelectForRead();\r
+ virtual bool SelectForWrite();\r
+\r
+ // Do we have any data to write? This is used by ShouldDelete.\r
+ virtual int GetOutboundDataSize() {return OutboundDataSize;}\r
+\r
+ protected:\r
+ struct OutboundPage {\r
+ OutboundPage (const char *b, int l, int o=0): Buffer(b), Length(l), Offset(o) {}\r
+ void Free() {if (Buffer) free ((char*)Buffer); }\r
+ const char *Buffer;\r
+ int Length;\r
+ int Offset;\r
+ };\r
+\r
+ protected:\r
+ deque<OutboundPage> OutboundPages;\r
+ int OutboundDataSize;\r
+\r
+ private:\r
+\r
+};\r
+\r
+\r
+#endif // __FileStreamDescriptor__H_\r
+\r