Commit 7a57e919 authored by Dan Wu's avatar Dan Wu
Browse files

Changed some non-primitive parameters to be passed by const reference (usually...

Changed some non-primitive parameters to be passed by const reference (usually faster and recommended in C++) instead of by value.
parent 4c8ebe39
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
#define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size() #define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size()
#define ARRAY_IN( A ) &A[0], A.size() #define ARRAY_IN( A ) &A[0], A.size()
bool smooth_test(const std::string filename, FBiGeom_Instance); bool smooth_test(const std::string &filename, FBiGeom_Instance);
bool tags_test(FBiGeom_Instance geom); bool tags_test(FBiGeom_Instance geom);
bool tag_get_set_test(FBiGeom_Instance geom); bool tag_get_set_test(FBiGeom_Instance geom);
...@@ -307,7 +307,7 @@ int main(int argc, char *argv[]) { ...@@ -307,7 +307,7 @@ int main(int argc, char *argv[]) {
@li Load a mesh file @li Load a mesh file
*/ */
bool smooth_test(const std::string filename, FBiGeom_Instance geom) { bool smooth_test(const std::string &filename, FBiGeom_Instance geom) {
int err; int err;
char opts[] = "SMOOTH;"; char opts[] = "SMOOTH;";
FBiGeom_load(geom, &filename[0], opts, &err, filename.length(), 8); FBiGeom_load(geom, &filename[0], opts, &err, filename.length(), 8);
......
...@@ -117,7 +117,7 @@ public: ...@@ -117,7 +117,7 @@ public:
#define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size() #define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size()
#define ARRAY_IN( A ) &A[0], A.size() #define ARRAY_IN( A ) &A[0], A.size()
bool smooth_test(const std::string filename, FBiGeom_Instance); bool smooth_test(const std::string &filename, FBiGeom_Instance);
bool tags_test(FBiGeom_Instance geom); bool tags_test(FBiGeom_Instance geom);
bool tag_get_set_test(FBiGeom_Instance geom); bool tag_get_set_test(FBiGeom_Instance geom);
...@@ -337,7 +337,7 @@ int main(int argc, char *argv[]) { ...@@ -337,7 +337,7 @@ int main(int argc, char *argv[]) {
@li Load a mesh file @li Load a mesh file
*/ */
bool smooth_test(const std::string filename, FBiGeom_Instance geom) { bool smooth_test(const std::string &filename, FBiGeom_Instance geom) {
int err; int err;
char opts[] = "SMOOTH;"; char opts[] = "SMOOTH;";
FBiGeom_load(geom, &filename[0], opts, &err, filename.length(), 8); FBiGeom_load(geom, &filename[0], opts, &err, filename.length(), 8);
......
...@@ -93,7 +93,7 @@ template <typename T> class SimpleArray ...@@ -93,7 +93,7 @@ template <typename T> class SimpleArray
#define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size() #define ARRAY_INOUT( A ) A.ptr(), &A.capacity(), &A.size()
#define ARRAY_IN( A ) &A[0], A.size() #define ARRAY_IN( A ) &A[0], A.size()
bool gLoad_test(const std::string filename, FBiGeom_Instance); bool gLoad_test(const std::string &filename, FBiGeom_Instance);
bool tags_test(FBiGeom_Instance geom); bool tags_test(FBiGeom_Instance geom);
bool tag_get_set_test(FBiGeom_Instance geom); bool tag_get_set_test(FBiGeom_Instance geom);
...@@ -280,7 +280,7 @@ int main( int argc, char *argv[] ) ...@@ -280,7 +280,7 @@ int main( int argc, char *argv[] )
Load Mesh Load Mesh
@li Load a mesh file @li Load a mesh file
*/ */
bool gLoad_test(const std::string filename, FBiGeom_Instance geom) bool gLoad_test(const std::string &filename, FBiGeom_Instance geom)
{ {
int err; int err;
FBiGeom_load( geom, &filename[0], 0, &err, filename.length(), 0 ); FBiGeom_load( geom, &filename[0], 0, &err, filename.length(), 0 );
......
...@@ -302,7 +302,7 @@ public: ...@@ -302,7 +302,7 @@ public:
}; };
inline MeshSet::hdl_iter::difference_type inline MeshSet::hdl_iter::difference_type
operator-( const MeshSet::hdl_iter a, const MeshSet::hdl_iter b ) operator-( const MeshSet::hdl_iter &a, const MeshSet::hdl_iter &b )
{ return (MeshSet::hdl_iter::difference_type)a.h { return (MeshSet::hdl_iter::difference_type)a.h
- (MeshSet::hdl_iter::difference_type)b.h; } - (MeshSet::hdl_iter::difference_type)b.h; }
......
...@@ -266,7 +266,7 @@ ErrorCode ScdInterface::assign_global_ids(ScdBox *box) ...@@ -266,7 +266,7 @@ ErrorCode ScdInterface::assign_global_ids(ScdBox *box)
return MB_SUCCESS; return MB_SUCCESS;
} }
ErrorCode ScdInterface::create_scd_sequence(HomCoord low, HomCoord high, EntityType tp, ErrorCode ScdInterface::create_scd_sequence(const HomCoord &low, const HomCoord &high, EntityType tp,
int starting_id, ScdBox *&new_box, int starting_id, ScdBox *&new_box,
int *is_periodic) int *is_periodic)
{ {
...@@ -315,7 +315,7 @@ ErrorCode ScdInterface::create_scd_sequence(HomCoord low, HomCoord high, EntityT ...@@ -315,7 +315,7 @@ ErrorCode ScdInterface::create_scd_sequence(HomCoord low, HomCoord high, EntityT
return MB_SUCCESS; return MB_SUCCESS;
} }
ErrorCode ScdInterface::create_box_set(const HomCoord low, const HomCoord high, ErrorCode ScdInterface::create_box_set(const HomCoord &low, const HomCoord &high,
EntityHandle &scd_set, int *is_periodic) EntityHandle &scd_set, int *is_periodic)
{ {
// create the set and put the entities in it // create the set and put the entities in it
......
...@@ -139,7 +139,7 @@ ErrorCode WriteUtil::get_node_coords(const int num_arrays, ...@@ -139,7 +139,7 @@ ErrorCode WriteUtil::get_node_coords(const int num_arrays,
ErrorCode WriteUtil::get_node_coords(const int which_array, /* 0->X, 1->Y, 2->Z, -1->all */ ErrorCode WriteUtil::get_node_coords(const int which_array, /* 0->X, 1->Y, 2->Z, -1->all */
Range::const_iterator iter, Range::const_iterator iter,
const Range::const_iterator end, const Range::const_iterator& end,
const size_t output_array_len, const size_t output_array_len,
double* const output_array) double* const output_array)
{ {
...@@ -314,7 +314,7 @@ ErrorCode WriteUtil::get_element_connect(const int num_elements, ...@@ -314,7 +314,7 @@ ErrorCode WriteUtil::get_element_connect(const int num_elements,
} }
ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter, ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter,
const Range::const_iterator end, const Range::const_iterator& end,
const int vertices_per_elem, const int vertices_per_elem,
Tag node_id_tag, Tag node_id_tag,
const size_t elem_array_size, const size_t elem_array_size,
...@@ -420,7 +420,7 @@ ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter, ...@@ -420,7 +420,7 @@ ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter,
} }
ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter, ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter,
const Range::const_iterator end, const Range::const_iterator& end,
const int vertices_per_elem, const int vertices_per_elem,
const size_t elem_array_size, const size_t elem_array_size,
EntityHandle *const element_array) EntityHandle *const element_array)
...@@ -511,14 +511,14 @@ ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter, ...@@ -511,14 +511,14 @@ ErrorCode WriteUtil::get_element_connect(Range::const_iterator iter,
} }
ErrorCode WriteUtil::get_poly_connect_size(Range::const_iterator /* begin */, ErrorCode WriteUtil::get_poly_connect_size(Range::const_iterator /* begin */,
const Range::const_iterator /* end */ , const Range::const_iterator& /* end */ ,
int& /* connectivity_size */) int& /* connectivity_size */)
{ {
return MB_NOT_IMPLEMENTED; return MB_NOT_IMPLEMENTED;
} }
ErrorCode WriteUtil::get_poly_connect(Range::const_iterator& /* iter */, ErrorCode WriteUtil::get_poly_connect(Range::const_iterator& /* iter */,
const Range::const_iterator /* end */ , const Range::const_iterator& /* end */ ,
const Tag /* node_id_tag */ , const Tag /* node_id_tag */ ,
size_t& /* handle_array_len */, size_t& /* handle_array_len */,
int *const /* handle_array */, int *const /* handle_array */,
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
*/ */
ErrorCode get_node_coords(const int which_array, ErrorCode get_node_coords(const int which_array,
Range::const_iterator begin, Range::const_iterator begin,
const Range::const_iterator end, const Range::const_iterator& end,
const size_t output_size, const size_t output_size,
double* const output_array); double* const output_array);
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
*\author Jason Kraftcheck *\author Jason Kraftcheck
*/ */
ErrorCode get_element_connect(Range::const_iterator begin, ErrorCode get_element_connect(Range::const_iterator begin,
const Range::const_iterator end, const Range::const_iterator& end,
const int vertices_per_elem, const int vertices_per_elem,
Tag node_id_tag, Tag node_id_tag,
const size_t array_size, const size_t array_size,
...@@ -167,7 +167,7 @@ public: ...@@ -167,7 +167,7 @@ public:
*\author Jason Kraftcheck *\author Jason Kraftcheck
*/ */
virtual ErrorCode get_element_connect(Range::const_iterator begin, virtual ErrorCode get_element_connect(Range::const_iterator begin,
const Range::const_iterator end, const Range::const_iterator& end,
const int vertices_per_elem, const int vertices_per_elem,
const size_t array_size, const size_t array_size,
EntityHandle *const element_array); EntityHandle *const element_array);
...@@ -180,7 +180,7 @@ public: ...@@ -180,7 +180,7 @@ public:
*\author Jason Kraftcheck *\author Jason Kraftcheck
*/ */
virtual ErrorCode get_poly_connect_size(Range::const_iterator begin, virtual ErrorCode get_poly_connect_size(Range::const_iterator begin,
const Range::const_iterator end, const Range::const_iterator& end,
int& connectivity_size); int& connectivity_size);
/** Get poly (polygon or polyhedron) connectivity. /** Get poly (polygon or polyhedron) connectivity.
...@@ -211,7 +211,7 @@ public: ...@@ -211,7 +211,7 @@ public:
*\author Jason Kraftcheck *\author Jason Kraftcheck
*/ */
virtual ErrorCode get_poly_connect(Range::const_iterator& iter, virtual ErrorCode get_poly_connect(Range::const_iterator& iter,
const Range::const_iterator end, const Range::const_iterator& end,
const Tag node_id_tag, const Tag node_id_tag,
size_t& handle_array_len, size_t& handle_array_len,
int *const handle_array, int *const handle_array,
......
...@@ -13,7 +13,7 @@ const char PFX[] = ">>> "; ...@@ -13,7 +13,7 @@ const char PFX[] = ">>> ";
namespace moab { namespace moab {
IODebugTrack::IODebugTrack( bool enabled, IODebugTrack::IODebugTrack( bool enabled,
const std::string name, const std::string& name,
std::ostream& output_stream, std::ostream& output_stream,
unsigned long table_size ) unsigned long table_size )
: enableOutput(enabled), : enableOutput(enabled),
...@@ -30,7 +30,7 @@ IODebugTrack::IODebugTrack( bool enabled, ...@@ -30,7 +30,7 @@ IODebugTrack::IODebugTrack( bool enabled,
IODebugTrack::IODebugTrack( bool enabled, IODebugTrack::IODebugTrack( bool enabled,
const std::string name, const std::string& name,
unsigned long table_size ) unsigned long table_size )
: enableOutput(enabled), : enableOutput(enabled),
tableName(name), tableName(name),
......
...@@ -42,7 +42,7 @@ class IODebugTrack { ...@@ -42,7 +42,7 @@ class IODebugTrack {
*\param table_size Max table size. No limit if unspecified *\param table_size Max table size. No limit if unspecified
*/ */
IODebugTrack( bool enable, IODebugTrack( bool enable,
const std::string table_name, const std::string& table_name,
std::ostream& output_stream, std::ostream& output_stream,
unsigned long table_size = 0 ) ; unsigned long table_size = 0 ) ;
...@@ -51,7 +51,7 @@ class IODebugTrack { ...@@ -51,7 +51,7 @@ class IODebugTrack {
*\param table_size Max table size. No limit if unspecified *\param table_size Max table size. No limit if unspecified
*/ */
IODebugTrack( bool enable, IODebugTrack( bool enable,
const std::string table_name, const std::string& table_name,
unsigned long table_size = 0 ) ; unsigned long table_size = 0 ) ;
/**\brief Destructor prints errors about unaccessed ranges */ /**\brief Destructor prints errors about unaccessed ranges */
......
...@@ -1410,7 +1410,7 @@ ErrorCode ReadABAQUS::get_nodes_by_id(EntityHandle parent_set, ...@@ -1410,7 +1410,7 @@ ErrorCode ReadABAQUS::get_nodes_by_id(EntityHandle parent_set,
ErrorCode ReadABAQUS::get_set_by_name(EntityHandle parent_set, ErrorCode ReadABAQUS::get_set_by_name(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
EntityHandle &set_handle) EntityHandle &set_handle)
{ {
ErrorCode status; ErrorCode status;
...@@ -1466,7 +1466,7 @@ ErrorCode ReadABAQUS::get_set_elements(EntityHandle set_handle, ...@@ -1466,7 +1466,7 @@ ErrorCode ReadABAQUS::get_set_elements(EntityHandle set_handle,
ErrorCode ReadABAQUS::get_set_elements_by_name(EntityHandle parent_set, ErrorCode ReadABAQUS::get_set_elements_by_name(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
Range &element_range) Range &element_range)
{ {
ErrorCode status; ErrorCode status;
...@@ -1487,7 +1487,7 @@ ErrorCode ReadABAQUS::get_set_elements_by_name(EntityHandle parent_set, ...@@ -1487,7 +1487,7 @@ ErrorCode ReadABAQUS::get_set_elements_by_name(EntityHandle parent_set,
ErrorCode ReadABAQUS::get_set_nodes(EntityHandle parent_set, ErrorCode ReadABAQUS::get_set_nodes(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
Range &node_range) Range &node_range)
{ {
ErrorCode status; ErrorCode status;
...@@ -1534,8 +1534,8 @@ Tag ReadABAQUS::get_tag(const char* tag_name, ...@@ -1534,8 +1534,8 @@ Tag ReadABAQUS::get_tag(const char* tag_name,
ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set, ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set,
const EntityHandle assembly_set, const EntityHandle assembly_set,
const std::string part_name, const std::string &part_name,
const std::string /*instance_name*/, const std::string &/*instance_name*/,
EntityHandle &instance_set, EntityHandle &instance_set,
const std::vector<double> &translation, const std::vector<double> &translation,
const std::vector<double> &rotation) const std::vector<double> &rotation)
...@@ -1883,7 +1883,7 @@ ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set, ...@@ -1883,7 +1883,7 @@ ErrorCode ReadABAQUS::create_instance_of_part(const EntityHandle file_set,
ErrorCode ReadABAQUS::add_entity_set(EntityHandle parent_set, ErrorCode ReadABAQUS::add_entity_set(EntityHandle parent_set,
int ABQ_Set_Type, int ABQ_Set_Type,
std::string set_name, const std::string &set_name,
EntityHandle &entity_set) EntityHandle &entity_set)
{ {
ErrorCode status; ErrorCode status;
...@@ -2039,7 +2039,7 @@ std::string ReadABAQUS::match(const std::string &token, ...@@ -2039,7 +2039,7 @@ std::string ReadABAQUS::match(const std::string &token,
} }
// Convert a string to upper case // Convert a string to upper case
void ReadABAQUS::stringToUpper(std::string toBeConverted, std::string& converted) void ReadABAQUS::stringToUpper(const std::string& toBeConverted, std::string& converted)
{ {
converted = toBeConverted; converted = toBeConverted;
...@@ -2048,13 +2048,13 @@ void ReadABAQUS::stringToUpper(std::string toBeConverted, std::string& converted ...@@ -2048,13 +2048,13 @@ void ReadABAQUS::stringToUpper(std::string toBeConverted, std::string& converted
} }
// Extract key/value pairs from parameter list // Extract key/value pairs from parameter list
void ReadABAQUS::extract_keyword_parameters(std::vector<std::string> tokens, void ReadABAQUS::extract_keyword_parameters(const std::vector<std::string>& tokens,
std::map<std::string, std::string>& params) std::map<std::string, std::string>& params)
{ {
std::string key, value; std::string key, value;
// NOTE: skip first token - it is the keyword // NOTE: skip first token - it is the keyword
for (std::vector<std::string>::iterator token = tokens.begin() + 1; for (std::vector<std::string>::const_iterator token = tokens.begin() + 1;
token != tokens.end(); ++token) { token != tokens.end(); ++token) {
std::string::size_type pos = token->find('='); std::string::size_type pos = token->find('=');
stringToUpper(token->substr(0, pos), key); stringToUpper(token->substr(0, pos), key);
......
...@@ -373,7 +373,7 @@ private: ...@@ -373,7 +373,7 @@ private:
ErrorCode get_set_by_name(EntityHandle parent_set, ErrorCode get_set_by_name(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
EntityHandle &set_handle); EntityHandle &set_handle);
ErrorCode get_set_elements(EntityHandle set_handle, ErrorCode get_set_elements(EntityHandle set_handle,
...@@ -381,23 +381,23 @@ private: ...@@ -381,23 +381,23 @@ private:
ErrorCode get_set_elements_by_name(EntityHandle parent_set, ErrorCode get_set_elements_by_name(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
Range &element_range); Range &element_range);
ErrorCode get_set_nodes(EntityHandle parent_set, ErrorCode get_set_nodes(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
Range &node_range); Range &node_range);
ErrorCode add_entity_set(EntityHandle parent_set, ErrorCode add_entity_set(EntityHandle parent_set,
int ABQ_set_type, int ABQ_set_type,
std::string set_name, const std::string &set_name,
EntityHandle &entity_set); EntityHandle &entity_set);
ErrorCode create_instance_of_part(const EntityHandle file_set, ErrorCode create_instance_of_part(const EntityHandle file_set,
const EntityHandle parent_set, const EntityHandle parent_set,
const std::string part_name, const std::string &part_name,
const std::string instance_name, const std::string &instance_name,
EntityHandle &entity_set, EntityHandle &entity_set,
const std::vector<double> &translation, const std::vector<double> &translation,
const std::vector<double> &rotation); const std::vector<double> &rotation);
...@@ -416,9 +416,9 @@ private: ...@@ -416,9 +416,9 @@ private:
std::string match(const std::string &token, std::string match(const std::string &token,
std::map<std::string,T> &tokenList); std::map<std::string,T> &tokenList);
void stringToUpper(std::string toBeConverted,std::string& converted); void stringToUpper(const std::string& toBeConverted,std::string& converted);
void extract_keyword_parameters(std::vector<std::string> tokens, void extract_keyword_parameters(const std::vector<std::string>& tokens,
std::map<std::string, std::string>& params); std::map<std::string, std::string>& params);
//! Interface instance //! Interface instance
......
...@@ -204,7 +204,7 @@ ErrorCode ReadNASTRAN::load_file(const char *filename, ...@@ -204,7 +204,7 @@ ErrorCode ReadNASTRAN::load_file(const char *filename,
large field: 1x8, 4x16, 1x8. Field 1 must have an asterisk following the character string large field: 1x8, 4x16, 1x8. Field 1 must have an asterisk following the character string
free field: each line entry must be separated by a comma free field: each line entry must be separated by a comma
Implementation tries to avoid more searches than necessary. */ Implementation tries to avoid more searches than necessary. */
ErrorCode ReadNASTRAN::determine_line_format(const std::string line, ErrorCode ReadNASTRAN::determine_line_format(const std::string &line,
line_format &format) line_format &format)
{ {
std::string::size_type found_asterisk = line.find("*"); std::string::size_type found_asterisk = line.find("*");
...@@ -226,7 +226,7 @@ ErrorCode ReadNASTRAN::determine_line_format(const std::string line, ...@@ -226,7 +226,7 @@ ErrorCode ReadNASTRAN::determine_line_format(const std::string line,
} }
/* Tokenize the line. Continue-lines have not been implemented. */ /* Tokenize the line. Continue-lines have not been implemented. */
ErrorCode ReadNASTRAN::tokenize_line(const std::string line, const line_format format, ErrorCode ReadNASTRAN::tokenize_line(const std::string &line, const line_format format,
std::vector<std::string> &tokens) std::vector<std::string> &tokens)
{ {
size_t line_size = line.size(); size_t line_size = line.size();
...@@ -252,7 +252,7 @@ ErrorCode ReadNASTRAN::tokenize_line(const std::string line, const line_format f ...@@ -252,7 +252,7 @@ ErrorCode ReadNASTRAN::tokenize_line(const std::string line, const line_format f
return MB_SUCCESS; return MB_SUCCESS;
} }
ErrorCode ReadNASTRAN::determine_entity_type(const std::string first_token, ErrorCode ReadNASTRAN::determine_entity_type(const std::string &first_token,
EntityType &type) EntityType &type)
{ {
if (0 == first_token.compare("GRID ")) if (0 == first_token.compare("GRID "))
...@@ -284,7 +284,7 @@ ErrorCode ReadNASTRAN::determine_entity_type(const std::string first_token, ...@@ -284,7 +284,7 @@ ErrorCode ReadNASTRAN::determine_entity_type(const std::string first_token,
has the coordinates: ( 3.980454, 6.9052e-1, 5.6008e-1 ) has the coordinates: ( 3.980454, 6.9052e-1, 5.6008e-1 )
GRID 200005 04.004752-3.985-15.4955-1 GRID 200005 04.004752-3.985-15.4955-1
has the coordinates: ( 4.004752, -3.985e-1, 5.4955e-1 ) */ has the coordinates: ( 4.004752, -3.985e-1, 5.4955e-1 ) */
ErrorCode ReadNASTRAN::get_real(const std::string token, double &real) ErrorCode ReadNASTRAN::get_real(const std::string &token, double &real)
{ {
std::string significand = token; std::string significand = token;
std::string exponent = "0"; std::string exponent = "0";
...@@ -343,7 +343,7 @@ ErrorCode ReadNASTRAN::get_real(const std::string token, double &real) ...@@ -343,7 +343,7 @@ ErrorCode ReadNASTRAN::get_real(const std::string token, double &real)
/* It has been determined that this line is a vertex. Read the rest of /* It has been determined that this line is a vertex. Read the rest of
the line and create the vertex. */ the line and create the vertex. */
ErrorCode ReadNASTRAN::read_node(const std::vector<std::string> tokens, ErrorCode ReadNASTRAN::read_node(const std::vector<std::string> &tokens,
const bool debug, const bool debug,
double* coords[3], double* coords[3],
int& id) int& id)
...@@ -376,7 +376,7 @@ ErrorCode ReadNASTRAN::read_node(const std::vector<std::string> tokens, ...@@ -376,7 +376,7 @@ ErrorCode ReadNASTRAN::read_node(const std::vector<std::string> tokens,
/* The type of element has already been identified. Read the rest of the /* The type of element has already been identified. Read the rest of the
line and create the element. Assume that all of the nodes have already line and create the element. Assume that all of the nodes have already
been created. */ been created. */
ErrorCode ReadNASTRAN::read_element(const std::vector<std::string> tokens, ErrorCode ReadNASTRAN::read_element(const std::vector<std::string> &tokens,
std::vector<Range> &materials, std::vector<Range> &materials,
const EntityType element_type, const EntityType element_type,
const bool /*debug*/) const bool /*debug*/)
......
...@@ -84,23 +84,23 @@ private: ...@@ -84,23 +84,23 @@ private:
LARGE_FIELD, LARGE_FIELD,
FREE_FIELD }; FREE_FIELD };
ErrorCode determine_line_format( const std::string line, ErrorCode determine_line_format( const std::string &line,
line_format &format ); line_format &format );
ErrorCode tokenize_line( const std::string line, ErrorCode tokenize_line( const std::string &line,
const line_format format, const line_format format,
std::vector<std::string> &tokens ); std::vector<std::string> &tokens );
ErrorCode determine_entity_type( const std::string token, EntityType &type); ErrorCode determine_entity_type( const std::string &token, EntityType &type);
ErrorCode get_real( const std::string, double &real ); ErrorCode get_real( const std::string&, double &real );
ErrorCode read_node(const std::vector<std::string> tokens, ErrorCode read_node(const std::vector<std::string> &tokens,
const bool debug,