OPS_Stream.h

Go to the documentation of this file.
00001 /* ****************************************************************** **
00002 **    OpenSees - Open System for Earthquake Engineering Simulation    **
00003 **          Pacific Earthquake Engineering Research Center            **
00004 **                                                                    **
00005 **                                                                    **
00006 ** (C) Copyright 1999, The Regents of the University of California    **
00007 ** All Rights Reserved.                                               **
00008 **                                                                    **
00009 ** Commercial use of this program without express permission of the   **
00010 ** University of California, Berkeley, is strictly prohibited.  See   **
00011 ** file 'COPYRIGHT'  in main directory for information on usage and   **
00012 ** redistribution,  and for a DISCLAIMER OF ALL WARRANTIES.           **
00013 **                                                                    **
00014 ** Developed by:                                                      **
00015 **   Frank McKenna (fmckenna@ce.berkeley.edu)                         **
00016 **   Gregory L. Fenves (fenves@ce.berkeley.edu)                       **
00017 **   Filip C. Filippou (filippou@ce.berkeley.edu)                     **
00018 **                                                                    **
00019 ** ****************************************************************** */
00020                                                                         
00021 // $Revision: 1.3 $
00022 // $Date: 2006/08/03 23:23:20 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/handler/OPS_Stream.h,v $
00024 
00025 #ifndef _OPS_Stream
00026 #define _OPS_Stream
00027 
00028 #include <MovableObject.h>
00029 enum openMode  {OVERWRITE, APPEND};
00030 enum floatField {FIXEDD, SCIENTIFIC};
00031 class Vector;
00032 
00033 
00034 class OPS_Stream:  public MovableObject
00035 {
00036  public:
00037   OPS_Stream(int classTag);
00038   virtual ~OPS_Stream();
00039 
00040   virtual int setFile(const char *fileName, openMode mode = OVERWRITE) {return 0;};
00041   virtual int setPrecision(int precision) {return 0;};
00042   virtual int setFloatField(floatField) {return 0;};
00043   virtual int precision(int precision) {return 0;};
00044   virtual int width(int width) {return 0;};
00045 
00046   // xml stuff
00047   virtual int tag(const char *) =0;
00048   virtual int tag(const char *, const char *) =0;
00049   virtual int endTag() =0;
00050   virtual int attr(const char *name, int value) =0;
00051   virtual int attr(const char *name, double value) =0;
00052   virtual int attr(const char *name, const char *value) =0;
00053   virtual int write(Vector &data) =0;
00054 
00055   // regular stuff
00056   virtual OPS_Stream& write(const char *s, int n) {return *this;};
00057   virtual OPS_Stream& write(const unsigned char *s, int n) {return *this;};
00058   virtual OPS_Stream& write(const signed char *s, int n) {return *this;};
00059   virtual OPS_Stream& write(const void *s, int n) {return *this;};
00060 
00061   virtual OPS_Stream& operator<<(char c) {return *this;};
00062   virtual OPS_Stream& operator<<(unsigned char c) {return *this;};
00063   virtual OPS_Stream& operator<<(signed char c) {return *this;};
00064   virtual OPS_Stream& operator<<(const char *s) {return *this;};
00065   virtual OPS_Stream& operator<<(const unsigned char *s) {return *this;};
00066   virtual OPS_Stream& operator<<(const signed char *s) {return *this;};
00067   virtual OPS_Stream& operator<<(const void *p) {return *this;};
00068   virtual OPS_Stream& operator<<(int n) {return *this;};
00069   virtual OPS_Stream& operator<<(unsigned int n) {return *this;};
00070   virtual OPS_Stream& operator<<(long n) {return *this;};
00071   virtual OPS_Stream& operator<<(unsigned long n) {return *this;};
00072   virtual OPS_Stream& operator<<(short n) {return *this;};
00073   virtual OPS_Stream& operator<<(unsigned short n) {return *this;};
00074   virtual OPS_Stream& operator<<(bool b) {return *this;};
00075   virtual OPS_Stream& operator<<(double n) {return *this;};
00076   virtual OPS_Stream& operator<<(float n) {return *this;};
00077 
00078   int sendSelf(int commitTag, Channel &theChannel) =0;  
00079   int recvSelf(int commitTag, Channel &theChannel, 
00080                FEM_ObjectBroker &theBroker) =0;
00081 
00082 
00083  private:
00084 
00085   void indent(void);
00086   int numIndent;
00087   char *indentString;
00088 };
00089 
00090 #endif

Generated on Mon Oct 23 15:05:13 2006 for OpenSees by doxygen 1.5.0