Ejemplo n.º 1
0
std::string Ioss::Asym_Tensor_01::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:  return XY();
  default: return "";
  }
}
Ejemplo n.º 2
0
std::string Ioss::Quaternion_2D::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:  return S();
  case 2:  return Q();
  default: return "";
  }
}
Ejemplo n.º 3
0
std::string Ioss::Vector_2D::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:    return X();
  case 2:    return Y();
  default:   return "";
  }
}
Ejemplo n.º 4
0
std::string Ioss::Full_Tensor_12::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:  return XX();
  case 2:  return XY();
  case 3:  return YX();
  default: return "";
 }
}
Ejemplo n.º 5
0
std::string Ioss::Scalar::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:
    return "";
  default:
    return "";
  }
}
Ejemplo n.º 6
0
std::string Ioss::Sym_Tensor_33::label(int which, const char) const
{
  assert(which > 0 && which <= component_count());
  switch(which) {
  case 1:  return XX();
  case 2:  return YY();
  case 3:  return ZZ();
  case 4:  return XY();
  case 5:  return YZ();
  case 6:  return ZX();
  default: return "";
  }
}
Ejemplo n.º 7
0
std::string CompositeVariableType::label(int which, const char suffix_sep) const
{
    static char tmp_sep[2];

    // NOTE: 'which' is 1-based
    assert(which > 0 && which <= component_count());

    int base_comp = baseType->component_count();
    int which_instance = (which-1) / base_comp;
    int which_base = (which-1) % base_comp;

    std::string my_label = baseType->label(which_base+1, suffix_sep);
    if (suffix_sep != 0 && base_comp > 1) {
        tmp_sep[0] = suffix_sep;
        my_label += tmp_sep;
    }
    my_label += VariableType::numeric_label(which_instance+1, copies_, name());
    return my_label;
}
Ejemplo n.º 8
0
static int
prepare_components (call_frame_t *frame)
{
        server_state_t       *state = NULL;
        xlator_t             *this = NULL;
        server_resolve_t     *resolve = NULL;
        char                 *resolved = NULL;
        int                   count = 0;
        struct resolve_comp  *components = NULL;
        int                   i = 0;
        char                 *trav = NULL;


        state = CALL_STATE (frame);
        this  = frame->this;
        resolve = state->resolve_now;

        resolved = gf_strdup (resolve->path);
        resolve->resolved = resolved;

        count = component_count (resolve->path);
        components = GF_CALLOC (sizeof (*components), count,
                                gf_server_mt_resolve_comp);
        resolve->components = components;

        components[0].basename = "";
        components[0].ino      = 1;
        components[0].gen      = 0;
        components[0].inode    = state->itable->root;

        i = 1;
        for (trav = resolved; *trav; trav++) {
                if (*trav == '/') {
                        components[i].basename = trav + 1;
                        *trav = 0;
                        i++;
                }
        }

        return 0;
}