Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Window.C File Reference

This file contains the implementation of the Window object. More...

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include "Window.h"
#include "roccom_assertion.h"
Include dependency graph for Window.C:

Go to the source code of this file.

Functions

template<class Attr >
void get_size_common (const Attr *a, int pid, int *nitem, int *ng) throw ( COM_exception)
 
template<class Attr >
void get_array_common (const Attr *a, int pid, Window::Pointer_descriptor &addr, int *strd, int *cap, bool is_const) throw (COM_exception)
 
template<class Attr >
void copy_array_common (const Attr *a, int pid, void *val, int v_strd, int v_size, int offset) throw (COM_exception)
 

Detailed Description

This file contains the implementation of the Window object.

See Also
roccom_devel.h, Roccom_base.C

Definition in file Window.C.

Function Documentation

void copy_array_common ( const Attr *  a,
int  pid,
void *  val,
int  v_strd,
int  v_size,
int  offset 
)
throw (COM_exception
)
inline

Definition at line 674 of file Window.C.

References append_frame, COM_ERR_NOT_A_WINDOW_ATTRIBUTE, Attribute::COPY_OUT, and offset().

Referenced by Window::copy_array().

675  {
676 
677  if ( pid==0 && a->location() != 'w')
679  ( a->fullname(), Window::copy_size));
680 
681  const_cast<Attr*>(a)->copy_array( val, v_strd, v_size,
683 }
real *8 function offset(vNorm, x2, y2, z2)
Definition: PlaneNorm.f90:211
Encapsulates the states of an exception.
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.

Here is the call graph for this function:

Here is the caller graph for this function:

void get_array_common ( const Attr *  a,
int  pid,
Window::Pointer_descriptor addr,
int *  strd,
int *  cap,
bool  is_const 
)
throw (COM_exception
)

Definition at line 602 of file Window.C.

References append_frame, COM_ERR_ATTRIBUTE_CONST, COM_ERR_INVALID_DIMENSION, COM_ERR_INVALID_SIZE, COM_ERR_NOT_A_WINDOW_ATTRIBUTE, and Window::get_array().

Referenced by Window::get_array().

604  {
605  if ( !is_const && a->is_const() )
607  (a->fullname(),Window::get_array));
608 
609  if ( pid==0 && a->location() != 'w')
611  ( a->fullname(), Window::get_array));
612 
613  addr.ptr = (void*)(a->pointer());
614  if ( addr.dim==1) {
615  addr.n1 = a->capacity()*a->stride();
616  }
617  else if ( addr.dim == 2) {
618  if ( a->stride()>=a->size_of_components()) {
619  addr.n1 = a->stride();
620  addr.n2 = a->capacity();
621  }
622  else {
623  addr.n1 = a->capacity();
624  addr.n2 = a->size_of_components();
625  }
626  }
627  else {
628  // Scalars must have capacity 1!
629  if ( addr.dim==0 && (a->capacity()!=1 || a->size_of_components()!=1))
631  (a->fullname(),Window::get_array));
632  if ( addr.dim>2)
634  (a->fullname(),Window::get_array));
635  }
636 
637  if ( cap) *cap = a->capacity();
638  if ( strd) *strd = a->stride();
639 }
Encapsulates the states of an exception.
void get_array(const std::string &aname, const int pane_id, Pointer_descriptor &addr, int *strd=NULL, int *cap=NULL, bool is_const=false)
Get the address associated with an attribute for a specific pane.
Definition: Window.C:641
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.

Here is the call graph for this function:

Here is the caller graph for this function:

void get_size_common ( const Attr *  a,
int  pid,
int *  nitem,
int *  ng 
)
throw (COM_exception
)

Definition at line 493 of file Window.C.

References append_frame, COM_ERR_NOT_A_WINDOW_ATTRIBUTE, and Window::get_size().

Referenced by Window::get_size().

495 {
496  if ( pid==0 && a->location() != 'w')
498  ( a->fullname(), Window::get_size));
499 
500  if ( nitem) *nitem = a->size_of_items();
501  if ( ng) *ng = a->size_of_ghost_items();
502 }
void get_size(const std::string &aname, int pane_id, int *nitems, int *ng) const
Get the sizes of an attribute for a specific pane.
Definition: Window.C:505
Encapsulates the states of an exception.
#define append_frame(s, frame)
Macro for appending the information about the given frame to the string s.

Here is the call graph for this function:

Here is the caller graph for this function: