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.4 $
00022 // $Date: 2005/11/23 18:24:30 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/actor/actor/Actor.h,v $
00024                                                                         
00025                                                                         
00026 #ifndef Actor_h
00027 #define Actor_h
00028 
00029 // Written: fmk
00030 // Revision: A
00031 //
00032 // Purpose: This file contains the class definition for Actor.
00033 // Actor is meant to be an abstract base class and thus no objects of it's type
00034 // can be instantiated. 
00035 //
00036 // What: "@(#) Actor.h, revA"
00037 
00038 class ObjectBroker;
00039 class Message;
00040 class Channel;
00041 class ChannelAddress;
00042 class MovableObject;
00043 class Matrix;
00044 class Vector;
00045 class ID;
00046 class FEM_ObjectBroker;
00047 
00048 class ActorMethod
00049 {
00050   public:
00051     int tag;
00052     int (*theMethod)();
00053 };
00054 
00055 class Actor
00056 {
00057   public:
00058     Actor(Channel &theChannel, 
00059           FEM_ObjectBroker &theBroker,
00060           int numActorMethods =0);
00061     
00062     virtual ~Actor();
00063     
00064     virtual int  run(void) = 0;
00065 
00066     virtual int  addMethod(int tag, int (*fp)());
00067     virtual int  getMethod();
00068     virtual int  processMethod(int tag);
00069 
00070     virtual int sendObject(MovableObject &theObject, 
00071                            ChannelAddress *theAddress =0);  
00072     virtual int recvObject(MovableObject &theObject, 
00073                            ChannelAddress *theAddress =0);
00074 
00075     virtual int sendMessage(const Message &theMessage, 
00076                             ChannelAddress *theAddress =0);   
00077     virtual int recvMessage(Message &theMessage, 
00078                             ChannelAddress *theAddress =0);  
00079     
00080     virtual int sendMatrix(const Matrix &theMatrix, 
00081                            ChannelAddress *theAddress =0);   
00082     virtual int recvMatrix(Matrix &theMatrix, 
00083                            ChannelAddress *theAddress =0);  
00084     
00085     virtual int sendVector(const Vector &theVector, 
00086                            ChannelAddress *theAddress =0);   
00087     virtual int recvVector(Vector &theVector, 
00088                            ChannelAddress *theAddress =0);  
00089     
00090     virtual int sendID(const ID &theID, 
00091                        ChannelAddress *theAddress =0);   
00092     virtual int recvID(ID &theID, 
00093                        ChannelAddress *theAddress =0);  
00094 
00095     Channel             *getChannelPtr(void) const;
00096     FEM_ObjectBroker    *getObjectBrokerPtr(void) const;    
00097     ChannelAddress      *getShadowsAddressPtr(void) const;            
00098 
00099     virtual int barrierCheck(int result);
00100     void setCommitTag(int commitTag);
00101 
00102   protected:
00103     FEM_ObjectBroker *theBroker; 
00104     Channel *theChannel;    
00105     
00106   private:      
00107     int numMethods, maxNumMethods;
00108     ActorMethod **actorMethods;
00109     ChannelAddress *theRemoteShadowsAddress;
00110 
00111     int commitTag;
00112 };
00113 
00114 #endif
00115 

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