Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CloneAttribute Class Reference

#include <Agent.h>

Inheritance diagram for CloneAttribute:
Collaboration diagram for CloneAttribute:

Public Member Functions

 CloneAttribute (Agent *ag, int cond, std::string target_window_, std::string attr_, std::string parent_window_, std::string parent_attr_, int wg_=1, const char *ptnname_=0, int val_=0)
 
void create (std::string bufname)
 
- Public Member Functions inherited from AttributeBase
 AttributeBase (Agent *ag, std::string target_window_, std::string attr_)
 
virtual ~AttributeBase ()
 
virtual void assign (std::string bufname)
 

Protected Attributes

std::string parent_window
 
std::string parent_attr
 
int wg
 
const char * ptnname
 
int val
 
int condition
 

Additional Inherited Members

- Public Attributes inherited from AttributeBase
Agentagent
 
std::string target_window
 
std::string attr
 

Detailed Description

Definition at line 71 of file Agent.h.

Constructor & Destructor Documentation

CloneAttribute ( Agent ag,
int  cond,
std::string  target_window_,
std::string  attr_,
std::string  parent_window_,
std::string  parent_attr_,
int  wg_ = 1,
const char *  ptnname_ = 0,
int  val_ = 0 
)

Definition at line 129 of file Agent.C.

References ptnname.

132  :
133  AttributeBase(ag, target_window_, attr_),
134  parent_window(parent_window_), parent_attr(parent_attr_),
135  wg(wg_), val(val_), condition(cond)
136 {
137  ptnname = ptnname_?strdup(ptnname_):NULL;
138 }
std::string parent_window
Definition: Agent.h:73
int condition
Definition: Agent.h:78
AttributeBase(Agent *ag, std::string target_window_, std::string attr_)
Definition: Agent.h:51
std::string parent_attr
Definition: Agent.h:74
const char * ptnname
Definition: Agent.h:76

Member Function Documentation

void create ( std::string  bufname)
virtual

Reimplemented from AttributeBase.

Definition at line 140 of file Agent.C.

References AttributeBase::agent, AttributeBase::attr, COM_clone_attribute(), COM_get_attribute(), COM_get_attribute_handle(), condition, Agent::get_surface_window(), MAN_DEBUG, MPI_COMM_WORLD, parent_attr, parent_window, ptnname, AttributeBase::target_window, val, and wg.

141 {
142  if (parent_window=="") { // filling
144  }
145  if (COM_get_attribute_handle( bufname+attr) > 0) {
146  char loc1, loc2;
147  int type1, type2;
148  int ncomp1, ncomp2;
149  std::string unit1, unit2;
150  COM_get_attribute( bufname+attr, &loc1, &type1, &ncomp1, &unit1);
151  COM_get_attribute( parent_window+parent_attr, &loc2, &type2, &ncomp2, &unit2);
152  if (loc1 != loc2 || type1 != type2 || ncomp1 != ncomp2 || unit1 != unit2) {
153  std::cerr << "Rocstar Error: CloneAttribute::create(): Could not create " << target_window+attr << " in two different ways " << std::endl;
154  MPI_Abort(MPI_COMM_WORLD, -1);
155  }
156  else {
157  MAN_DEBUG(3, ("CloneAttribute::create: %s%s %s%s condition:%d handle:%d SKIPPED.\n", bufname.c_str(), attr.c_str(), parent_window.c_str(), parent_attr.c_str(), condition, COM_get_attribute_handle( parent_window+parent_attr)));
158  return;
159  }
160  }
161  MAN_DEBUG(3, ("CloneAttribute::create: %s%s %s%s condition:%d handle:%d.\n", bufname.c_str(), attr.c_str(), parent_window.c_str(), parent_attr.c_str(), condition, COM_get_attribute_handle( parent_window+parent_attr)));
162  if (condition)
164  if (ptnname) {
165  if (ptnname[0] == '.')
166  ptnname = strdup((agent->get_surface_window() + ptnname).c_str());
167  }
169 }
std::string target_window
Definition: Agent.h:48
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
std::string parent_window
Definition: Agent.h:73
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
Definition: roccom_c++.h:269
int condition
Definition: Agent.h:78
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
std::string get_surface_window() const
Definition: Agent.h:217
Agent * agent
Definition: Agent.h:47
void COM_clone_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Clone the subset of panes of another window of which the given pane attribute has value val...
Definition: roccom_c++.h:234
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
std::string attr
Definition: Agent.h:49
std::string parent_attr
Definition: Agent.h:74
const char * ptnname
Definition: Agent.h:76

Here is the call graph for this function:

Member Data Documentation

int condition
protected

Definition at line 78 of file Agent.h.

Referenced by create().

std::string parent_attr
protected

Definition at line 74 of file Agent.h.

Referenced by create().

std::string parent_window
protected

Definition at line 73 of file Agent.h.

Referenced by create().

const char* ptnname
protected

Definition at line 76 of file Agent.h.

Referenced by CloneAttribute(), and create().

int val
protected

Definition at line 77 of file Agent.h.

Referenced by create().

int wg
protected

Definition at line 75 of file Agent.h.

Referenced by create().


The documentation for this class was generated from the following files: