Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Actor.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.1.1.1 $
00022 // $Date: 2000/09/15 08:23:15 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/actor/Actor.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef Actor_h
00027 #define Actor_h
00028 
00029 // File: ~/actor/Actor.h
00030 //
00031 // Written: fmk
00032 // Created: 11/96
00033 // Revision: A
00034 //
00035 // Purpose: This file contains the class definition for Actor.
00036 // Actor is meant to be an abstract base class and thus no objects of it's type
00037 // can be instantiated. 
00038 //
00039 // What: "@(#) Actor.h, revA"
00040 
00041 #include <ObjectBroker.h>
00042 #include <Message.h>
00043 #include <Channel.h>
00044 #include <ChannelAddress.h>
00045 #include <MovableObject.h>
00046 #include <Matrix.h>
00047 #include <Vector.h>
00048 #include <ID.h>
00049 
00062 class ActorMethod
00063 {
00064   public:
00066     int tag;
00067 
00069     int (*theMethod)();
00070 };
00071 
00072 #include <FEM_ObjectBroker.h>
00073 
00075 class Actor
00076 {
00077   public:
00079     Actor(Channel &theChannel, 
00080    FEM_ObjectBroker &theBroker,
00081    int numActorMethods);
00082     
00084     virtual ~Actor();
00085 
00087     virtual int  addMethod(int tag, int (*fp)());
00089     virtual int  getMethod();
00091     virtual int  processMethod(int tag);
00092 
00094     virtual int sendObject(MovableObject &theObject, 
00095       ChannelAddress *theAddress =0);  
00097     virtual int recvObject(MovableObject &theObject, 
00098       ChannelAddress *theAddress =0);
00099 
00101     virtual int sendMessage(const Message &theMessage, 
00102        ChannelAddress *theAddress =0);   
00104     virtual int recvMessage(Message &theMessage, 
00105        ChannelAddress *theAddress =0);  
00106     
00108     virtual int sendMatrix(const Matrix &theMatrix, 
00109       ChannelAddress *theAddress =0);   
00111     virtual int recvMatrix(Matrix &theMatrix, 
00112       ChannelAddress *theAddress =0);  
00113     
00115     virtual int sendVector(const Vector &theVector, 
00116       ChannelAddress *theAddress =0);   
00118     virtual int recvVector(Vector &theVector, 
00119       ChannelAddress *theAddress =0);  
00120     
00122     virtual int sendID(const ID &theID, 
00123          ChannelAddress *theAddress =0);   
00125     virtual int recvID(ID &theID, 
00126          ChannelAddress *theAddress =0);  
00127 
00129     Channel   *getChannelPtr(void) const;
00131     FEM_ObjectBroker  *getObjectBrokerPtr(void) const;    
00133     ChannelAddress   *getShadowsAddressPtr(void) const;            
00134 
00135   protected:
00137     FEM_ObjectBroker *theBroker; 
00139     Channel *theChannel;    
00140     
00141   private: 
00143     int numMethods, maxNumMethods;
00145     ActorMethod **actorMethods;
00147     ChannelAddress *theRemoteShadowsAddress;
00148 
00149 };
00150 
00151 #endif
00152 
Copyright Contact Us