Channel.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.5 $
00022 // $Date: 2005/11/23 18:27:24 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/channel/Channel.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef Channel_h
00027 #define Channel_h
00028 
00029 // Written: fmk
00030 // Created: 11/96
00031 // Revision: A
00032 //
00033 // Purpose: This file contains the class definition for Channel.
00034 // Channel is an abstract base class which defines the channel interface.
00035 // A channel is a point of communication in a program, a mailbox to/from
00036 // which data enters/leaves a program.
00037 //
00038 // What: "@(#) Channel.h, revA"
00039 
00040 
00041 
00042 class ChannelAddress;
00043 class Message;
00044 class MovableObject;
00045 class Matrix;
00046 class Vector;
00047 class ID;
00048 class FEM_ObjectBroker;
00049 
00050 class Channel
00051 {
00052   public:
00053     Channel ();    
00054     virtual ~Channel();
00055 
00056     // methods to set up the channel in an actor space
00057     virtual char *addToProgram(void) =0;
00058     virtual int setUpConnection(void) =0;
00059     virtual int setNextAddress(const ChannelAddress &theAddress) =0;
00060     virtual ChannelAddress *getLastSendersAddress(void) =0;
00061 
00062     virtual int isDatastore(void);
00063     virtual int getDbTag(void);
00064         int getTag(void);
00065     
00066     // methods to send/receive messages and objects on channels.
00067     virtual int sendObj(int commitTag,
00068                         MovableObject &theObject, 
00069                         ChannelAddress *theAddress =0) =0;
00070 
00071     virtual int recvObj(int commitTag,
00072                         MovableObject &theObject, 
00073                         FEM_ObjectBroker &theBroker, 
00074                         ChannelAddress *theAddress =0) =0; 
00075 
00076     virtual int sendMsg(int dbTag, int commitTag, 
00077                         const Message &theMessage, 
00078                         ChannelAddress *theAddress =0) =0;  
00079 
00080     virtual int recvMsg(int dbTag, int commitTag, 
00081                         Message &theMessage, 
00082                         ChannelAddress *theAddress =0) =0;  
00083     
00084     virtual int sendMatrix(int dbTag, int commitTag, 
00085                            const Matrix &theMatrix, 
00086                            ChannelAddress *theAddress =0) =0;  
00087 
00088     virtual int recvMatrix(int dbTag, int commitTag, 
00089                            Matrix &theMatrix, 
00090                            ChannelAddress *theAddress =0) =0;  
00091     
00092     virtual int sendVector(int dbTag, int commitTag, 
00093                            const Vector &theVector, 
00094                            ChannelAddress *theAddress =0) =0;  
00095 
00096     virtual int recvVector(int dbTag, int commitTag, 
00097                            Vector &theVector, 
00098                            ChannelAddress *theAddress =0) =0;  
00099     
00100     virtual int sendID(int dbTag, int commitTag, 
00101                        const ID &theID, 
00102                        ChannelAddress *theAddress =0) =0;  
00103 
00104     virtual int recvID(int dbTag, int commitTag, 
00105                        ID &theID, 
00106                        ChannelAddress *theAddress =0) =0;      
00107 
00108   protected:
00109     
00110   private:
00111           static int numChannel;
00112           int tag;
00113 };
00114 
00115 #endif

Generated on Mon Oct 23 15:04:56 2006 for OpenSees by doxygen 1.5.0