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

Public Member Functions

 bcReader (FILE *in_)
 
 ~bcReader ()
 
bool read (int *dest)
 
bool read (blockSpan &ret)
 
bool read (blockDim &d)
 
bool skipLine (void)
 

Private Attributes

FILE * in
 

Detailed Description

Definition at line 70 of file readinp.cpp.

Constructor & Destructor Documentation

bcReader ( FILE *  in_)
inline

Definition at line 73 of file readinp.cpp.

74  :in(in_)
75  {
76 
77  }
FILE * in
Definition: readinp.cpp:71
~bcReader ( )
inline

Definition at line 78 of file readinp.cpp.

References cimg_library::cimg::fclose(), and in.

78 {fclose(in);}
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
FILE * in
Definition: readinp.cpp:71

Here is the call graph for this function:

Member Function Documentation

bool read ( int *  dest)
inline

Definition at line 81 of file readinp.cpp.

References in.

Referenced by read(), and readBoundaries().

81  {
82  int count=fscanf(in,"%d",dest);
83  return (count==1);
84  }
FILE * in
Definition: readinp.cpp:71

Here is the caller graph for this function:

bool read ( blockSpan ret)
inline

Definition at line 86 of file readinp.cpp.

References i, and read().

86  {
87  blockLoc start,end;
88  for (int i=0;i<3;i++) {
89  if (!(read(&start[i]) && read(&end[i])))
90  return false;
91  //Fix up some oddities in the .inp files
92  if (end[i]<0) end[i]=-end[i];
93  if (start[i]<0) start[i]=-start[i];
94 
95  //Make zero-based
96  end[i]--; start[i]--;
97 
98  if (end[i]<start[i])
99  { //Start and end are backwards for this axis:
100  int tmp=end[i];
101  end[i]=start[i];
102  start[i]=tmp;
103  }
104  end[i]++; //Make end into c-style
105  }
106  ret=blockSpan(start,end);
107  return true;
108  }
blockLoc i
Definition: read.cpp:79
bool read(int *dest)
Definition: readinp.cpp:81

Here is the call graph for this function:

bool read ( blockDim d)
inline

Definition at line 110 of file readinp.cpp.

References i, and read().

110  {
111  for (int i=0;i<3;i++)
112  if (!read(&d[i]))
113  return false;
114  return true;
115  }
blockLoc i
Definition: read.cpp:79
bool read(int *dest)
Definition: readinp.cpp:81

Here is the call graph for this function:

bool skipLine ( void  )
inline

Definition at line 117 of file readinp.cpp.

References in.

Referenced by readBoundaries().

117  {
118  char str[1024];
119  return NULL!=fgets(str,1024,in);
120  }
FILE * in
Definition: readinp.cpp:71

Here is the caller graph for this function:

Member Data Documentation

FILE* in
private

Definition at line 71 of file readinp.cpp.

Referenced by read(), skipLine(), and ~bcReader().


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