cgma
FacetAttribSet Class Reference

#include <FacetAttribSet.hpp>

List of all members.

Public Member Functions

 FacetAttribSet ()
 ~FacetAttribSet ()
void append_attribute (const CubitSimpleAttrib &)
void remove_attribute (const CubitSimpleAttrib &)
void remove_all_attributes ()
CubitStatus get_attributes (DLIList< CubitSimpleAttrib > &) const
CubitStatus get_attributes (const CubitString &name, DLIList< CubitSimpleAttrib > &) const
CubitStatus save_attributes (FILE *file) const
CubitStatus restore_attributes (FILE *file, unsigned int endian)
int attribute_count () const

Private Attributes

FacetAttriblistHead

Detailed Description

Definition at line 22 of file FacetAttribSet.hpp.


Constructor & Destructor Documentation

Definition at line 27 of file FacetAttribSet.hpp.

: listHead(0) {}

Definition at line 29 of file FacetAttribSet.hpp.


Member Function Documentation

Definition at line 18 of file FacetAttribSet.cpp.

{
  FacetAttrib* new_attrib = new FacetAttrib(csa);
  new_attrib->listNext = listHead;
  listHead = new_attrib;
}

Definition at line 121 of file FacetAttribSet.cpp.

{
  int count = 0;
  for( FacetAttrib* attrib = listHead; attrib; attrib = attrib->listNext )
    count++;
  return count;
}

Definition at line 61 of file FacetAttribSet.cpp.

{
  for( FacetAttrib* attrib = listHead; attrib; attrib = attrib->listNext )
    list.append( attrib->get_CSA() );
  return CUBIT_SUCCESS;
}

Definition at line 68 of file FacetAttribSet.cpp.

{
  for( FacetAttrib* attrib = listHead; attrib; attrib = attrib->listNext )
    if( attrib->name() == name )
      list.append( attrib->get_CSA() );
  return CUBIT_SUCCESS;
}

Definition at line 51 of file FacetAttribSet.cpp.

{
  while( listHead )
  {
    FacetAttrib* dead = listHead;
    listHead = dead->listNext;
    delete dead;
  }
}

Definition at line 25 of file FacetAttribSet.cpp.

{
  if( !listHead )
    return;
    
  FacetAttrib* attrib = 0;
  if ( listHead->equals(csa) )
  {
    attrib = listHead;
    listHead = listHead->listNext;
    delete attrib;
    return;
  }
  
  for ( FacetAttrib* prev = listHead; prev->listNext; prev = prev->listNext )
  {
    if( prev->listNext->equals(csa) )
    {
      attrib = prev->listNext;
      prev->listNext = attrib->listNext;
      delete attrib;
      return;
    }
  }
}
CubitStatus FacetAttribSet::restore_attributes ( FILE *  file,
unsigned int  endian 
)

Definition at line 95 of file FacetAttribSet.cpp.

{
  FacetAttrib *curr_attrib;
  
  //Read # attribs
  unsigned int size;
  NCubitFile::CIOWrapper wrapper( endian, file_ptr );
  wrapper.Read( &size, 1 ); 

  for (unsigned i = 0; i < size; i++)
  {
    curr_attrib = FacetAttrib::restore( file_ptr, endian);  
    if (!curr_attrib)
    {
        // file corrupt?  don't try to read any more
      return CUBIT_FAILURE;
    }
    
    curr_attrib->listNext = listHead;
    listHead = curr_attrib;
  }

  return CUBIT_SUCCESS;
}

Definition at line 77 of file FacetAttribSet.cpp.

{
  FacetAttrib *curr_attrib;
  CubitStatus status = CUBIT_SUCCESS;
  
  //save # attribs
  unsigned int size = attribute_count();
  NCubitFile::CIOWrapper wrapper( file_ptr );
  wrapper.Write( &size, 1 ); 

  //save each attrib
  for( curr_attrib = listHead; curr_attrib; curr_attrib = curr_attrib->listNext )
    if( !curr_attrib->save(file_ptr) )
      status = CUBIT_FAILURE;

  return status;
}

Member Data Documentation

Definition at line 50 of file FacetAttribSet.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines