DataOutputStreamHandler.cpp

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.2 $
00022 // $Date: 2004/11/24 22:40:16 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/handler/DataOutputStreamHandler.cpp,v $
00024                                                                         
00025 // Written: fmk 
00026 // Date: 10/04
00027 //
00028 // Description: This file contains the class implementation for
00029 // DataOutputStreamHandler. 
00030 //
00031 // What: "@(#) DataOutputStreamHandler.C, revA"
00032 
00033 #include "DataOutputStreamHandler.h"
00034 #include <Vector.h>
00035 
00036 DataOutputStreamHandler::DataOutputStreamHandler(bool echoD)
00037   :DataOutputHandler(DATAHANDLER_TAGS_DataOutputStreamHandler), 
00038    echoDescription(echoD), numColumns(0)
00039 {
00040 
00041 }
00042 
00043 DataOutputStreamHandler::~DataOutputStreamHandler()
00044 {
00045     // does nothing
00046 }
00047 
00048 int 
00049 DataOutputStreamHandler::open(char **dataDescription, int numData)
00050 {
00051   if (numData < 0) {
00052     opserr << "DataOutputStreamHandler::open() - numColumns (" << numData << ") < 0\n";
00053     return -1;
00054   } else
00055     numColumns = numData;
00056 
00057   if (echoDescription == true) {
00058     for (int i=0; i<numData; i++)
00059       opserr << dataDescription[i] << " ";
00060     opserr << endln;
00061   }
00062   
00063   return 0;
00064 }
00065 
00066 int 
00067 DataOutputStreamHandler::write(Vector &data) 
00068 {
00069   if (data.Size() == numColumns)
00070     outputStream << data;
00071   else {
00072     opserr << "DataOutputStreamHandler::write() - Vector not of correct size\n";
00073     return -1;
00074   }
00075   
00076   return 0;
00077 }
00078 
00079 int 
00080 DataOutputStreamHandler::sendSelf(int commitTag, Channel &theChannel)
00081 {
00082   return 0;
00083 }
00084 
00085 int 
00086 DataOutputStreamHandler::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
00087 {
00088   return 0;
00089 }

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