Commit ace3d1e1 authored by miller86's avatar miller86

Resolving #631, removing 'using' statements from all header files.

As a consequence, a lot of source files needed fixing up too. There
were many cases where source files referred to STL classes but either
did not include the cooresponding C++ STL header or did not have a
using statement or did not have a 'std::' scope resolution.

I added a hook to prevent commits of header files with using statements
in them. I added skips for anything in vendor_branches, release and
src/third_party_builtin and common/utility/visitstream.h (whose using
statements I think define a single symbol name such as cerr or endl).
Nonetheless, I still think visitstream.h might bare further scrutiny
on this issue.

There are a number of other observations I had regarding header file
design and usage that I will send to visit-developers in a follow-up
email.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@15352 18c085ea-50e0-402c-830e-de6fd14e8384
parent dc404fbc
......@@ -917,6 +917,7 @@ avtMeshMetaData::UnsetExtents()
// Creationist: Allen Sanderson
// Creation: March 3, 2011
//
// Modifications:
// Mark C. Miller, Tue Apr 19 14:46:23 PDT 2011
// Set logical bounds to integer value '0' and not '0.0'.
// ****************************************************************************
......@@ -935,17 +936,9 @@ avtMeshMetaData::SetBounds(const int *bounds)
else
{
hasLogicalBounds = true;
if( meshType == AVT_POINT_MESH || meshType == AVT_UNSTRUCTURED_MESH)
{
cerr << endl << "Setting bounds ..............." << endl;
logicalBounds[0] = bounds[0];
}
else
for (int i = 0 ; i < std::min(topologicalDimension, 3) ; i++)
{
for (int i = 0 ; i < std::min(topologicalDimension, 3) ; i++)
{
logicalBounds[i] = bounds[i];
}
}
}
}
......@@ -1181,8 +1174,7 @@ avtMeshMetaData::Print(ostream &out, int indent) const
{
Indent(out, indent);
out << "Logical bounds are: (";
if( meshType == AVT_POINT_MESH || meshType == AVT_UNSTRUCTURED_MESH)
if( meshType == AVT_POINT_MESH )
out << logicalBounds[0];
else
{
......@@ -1193,8 +1185,6 @@ avtMeshMetaData::Print(ostream &out, int indent) const
out << ", ";
}
}
out << ")" << endl;
}
else
{
......@@ -1202,7 +1192,6 @@ avtMeshMetaData::Print(ostream &out, int indent) const
{
case AVT_RECTILINEAR_MESH:
case AVT_CURVILINEAR_MESH:
case AVT_UNSTRUCTURED_MESH:
case AVT_POINT_MESH:
Indent(out, indent);
out << "The logical bounds are not set." << endl;
......@@ -1362,14 +1351,14 @@ avtMeshMetaData::SetAMRInfo(const std::string &levelName,
this->blockOrigin = origin;
this->groupOrigin = origin;
vector<int> groupIds(nlevels+1);
std::vector<int> groupIds(nlevels+1);
groupIds[0] = 0;
for (i = 1 ; i < nlevels+1 ; i++)
{
groupIds[i] = groupIds[i-1] + patchesPerLevel[i-1];
}
this->groupIdsBasedOnRange = groupIds;
vector<int> numbelow(nlevels);
std::vector<int> numbelow(nlevels);
numbelow[0] = 0;
for (i = 1 ; i < nlevels ; i++)
numbelow[i] = numbelow[i-1]+patchesPerLevel[i-1];
......@@ -1424,3 +1413,4 @@ avtMeshMetaData::SetAMRInfo(const std::string &levelName,
atts.SetNamescheme(base_string);
this->blockNameScheme = atts;
}
......@@ -724,14 +724,14 @@ avtMeshMetaData::SetAMRInfo(const std::string &levelName,
this->blockOrigin = origin;
this->groupOrigin = origin;
vector<int> groupIds(nlevels+1);
std::vector<int> groupIds(nlevels+1);
groupIds[0] = 0;
for (i = 1 ; i < nlevels+1 ; i++)
{
groupIds[i] = groupIds[i-1] + patchesPerLevel[i-1];
}
this->groupIdsBasedOnRange = groupIds;
vector<int> numbelow(nlevels);
std::vector<int> numbelow(nlevels);
numbelow[0] = 0;
for (i = 1 ; i < nlevels ; i++)
numbelow[i] = numbelow[i-1]+patchesPerLevel[i-1];
......
......@@ -45,8 +45,9 @@
#include <database_exports.h>
#include <vector>
#include <list>
#include <string>
#include <vector>
#include <void_ref_ptr.h>
......@@ -431,7 +432,7 @@ class DATABASE_API avtDatabase
void PopulateDataObjectInformation(avtDataObject_p&,
const char *,
int,
const vector<bool> &selsApplied,
const std::vector<bool> &selsApplied,
avtDataRequest_p =NULL);
bool GetExtentsFromAuxiliaryData(avtDataRequest_p spec,
const char *var,
......
......@@ -534,7 +534,7 @@ class DATABASE_API avtGenericDatabase : public avtDatasetDatabase
void EnumScalarSelect(avtDatasetCollection &,
const boolVector &,
const avtDatabaseMetaData*,
const string &);
const std::string &);
void CreateOriginalZones(avtDatasetCollection &,
intVector &,
avtSourceFromDatabase *);
......
......@@ -101,7 +101,7 @@ class DATABASE_API avtSILGenerator
bool useSILArrays,
SILCategoryRole cat = SIL_DOMAIN,
bool onlyCreateSets = false);
vector<int> AddGroups(avtSIL *, int, int, int, const std::string &,
std::vector<int> AddGroups(avtSIL *, int, int, int, const std::string &,
const std::string &);
void AddGroupCollections(avtSIL *, int, int,
const std::vector<int> &,
......
......@@ -1293,7 +1293,7 @@ avtTransformManager::TransformMaterialDataset(const avtDatabaseMetaData *const m
EXCEPTION1(PointerNotInCacheException, *vr);
}
string meshname = md->MeshForVar(vname);
std::string meshname = md->MeshForVar(vname);
const avtMeshMetaData *mmd = md->GetMesh(meshname);
if (mmd->meshType == AVT_CSG_MESH)
{
......@@ -1440,7 +1440,7 @@ avtTransformManager::AddVertexCellsToPointsOnlyDataset(avtDatabaseMetaData *md,
for (i = 0; i < md->GetNumMeshes(); i++)
{
avtMeshMetaData &mmd = md->GetMeshes(i);
if (mmd.name == string(mname))
if (mmd.name == std::string(mname))
{
mmd.meshType = AVT_POINT_MESH;
mmd.topologicalDimension = 0;
......@@ -1635,7 +1635,7 @@ vtkDataSet *ds, int dom)
for (i = 0; i < md->GetNumCurves(); i++)
{
cmd = md->GetCurve(i);
if (cmd->from1DScalarName == string(vname))
if (cmd->from1DScalarName == std::string(vname))
break;
cmd = 0;
}
......
......@@ -40,6 +40,8 @@
#include <VisItException.h>
#include <vtkStructuredGrid.h>
#include <vector>
#define BNDMIN(A,B) (((A) < (B)) ? (A) : (B))
#define BNDMAX(A,B) (((A) > (B)) ? (A) : (B))
......@@ -253,9 +255,9 @@ Boundary::AddNeighbor(int d, int mi, int o[3], int e[6])
//
// ****************************************************************************
void
Boundary::DeleteNeighbor(int d, vector<Boundary> &wholelist)
Boundary::DeleteNeighbor(int d, std::vector<Boundary> &wholelist)
{
vector<int> delete_list;
std::vector<int> delete_list;
for (size_t i=0; i<neighbors.size(); i++)
if (neighbors[i].domain == d)
delete_list.push_back(i);
......
......@@ -48,7 +48,6 @@
#include <avtGhostData.h>
#include <vector>
using std::vector;
class vtkDataSet;
class vtkDataArray;
......@@ -100,37 +99,37 @@ class DATABASE_API avtDomainBoundaries
avtDomainBoundaries();
virtual ~avtDomainBoundaries();
virtual vector<vtkDataSet*> ExchangeMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes) =0;
virtual std::vector<vtkDataSet*> ExchangeMesh(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes) =0;
virtual vector<vtkDataArray*> ExchangeScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars) =0;
std::vector<vtkDataArray*> scalars) =0;
virtual vector<vtkDataArray*> ExchangeFloatVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeFloatVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors) =0;
std::vector<vtkDataArray*> vectors) =0;
virtual vector<vtkDataArray*> ExchangeIntVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeIntVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors) =0;
std::vector<vtkDataArray*> vectors) =0;
virtual vector<avtMaterial*> ExchangeMaterial(vector<int> domainNum,
vector<avtMaterial*> mats) =0;
virtual std::vector<avtMaterial*> ExchangeMaterial(std::vector<int> domainNum,
std::vector<avtMaterial*> mats) =0;
virtual vector<avtMixedVariable*> ExchangeMixVar(vector<int> domainNum,
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars) =0;
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes,
vector<int> &) =0;
virtual std::vector<avtMixedVariable*> ExchangeMixVar(std::vector<int> domainNum,
const std::vector<avtMaterial*> mats,
std::vector<avtMixedVariable*> mixvars) =0;
virtual void CreateGhostNodes(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes,
std::vector<int> &) =0;
virtual bool CreatesRobustGhostNodes(void)
{ return true; };
virtual bool CanOnlyCreateGhostNodes(void)
{ return false; };
virtual bool RequiresCommunication(avtGhostDataType) = 0;
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes) =0;
virtual bool ConfirmMesh(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes) =0;
virtual void ResetCachedMembers(void) {;};
};
......
......@@ -46,7 +46,6 @@
#include <database_exports.h>
#include <vector>
using std::vector;
class vtkDataSet;
......@@ -79,11 +78,11 @@ class DATABASE_API avtDomainNesting
avtDomainNesting() {};
virtual ~avtDomainNesting() {} ;
virtual bool ApplyGhost(vector<int> domainList, vector<int> allDomainList,
vector<vtkDataSet*> meshes) = 0;
virtual bool ApplyGhost(std::vector<int> domainList, std::vector<int> allDomainList,
std::vector<vtkDataSet*> meshes) = 0;
virtual bool ConfirmMesh(vector<int> &, vector<vtkDataSet*> &) = 0;
virtual vector<int> GetRatiosForLevel(int level, int dom) = 0;
virtual bool ConfirmMesh(std::vector<int> &, std::vector<vtkDataSet*> &) = 0;
virtual std::vector<int> GetRatiosForLevel(int level, int dom) = 0;
};
#endif
......@@ -48,9 +48,6 @@
#include <avtGhostData.h>
#include <avtStreamingGhostGenerator.h>
#include <vector>
using std::vector;
class vtkDataSet;
class vtkDataArray;
class avtMixedVariable;
......
......@@ -46,7 +46,7 @@
#include <vtkUnsignedCharArray.h>
#include <vtkPointData.h>
#include <float.h>
#include <string.h>
#include <vector>
#ifdef PARALLEL
#include <mpi.h>
......@@ -58,6 +58,8 @@
#include <TimingsManager.h>
using std::vector;
// ****************************************************************************
// Method: avtNekDomainBoundaries::avtNekDomainBoundaries
//
......
......@@ -49,7 +49,6 @@
#include <avtGhostData.h>
#include <vector>
using std::vector;
class vtkDataSet;
class vtkDataArray;
......@@ -95,37 +94,37 @@ class DATABASE_API avtNekDomainBoundaries : public avtDomainBoundaries
static void Destruct(void *);
// These are required to be implemented, but an exception is thrown if used.
virtual vector<vtkDataSet*> ExchangeMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual std::vector<vtkDataSet*> ExchangeMesh(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes);
virtual vector<vtkDataArray*> ExchangeScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
std::vector<vtkDataArray*> scalars);
virtual vector<vtkDataArray*> ExchangeFloatVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeFloatVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
std::vector<vtkDataArray*> vectors);
virtual vector<vtkDataArray*> ExchangeIntVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeIntVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
std::vector<vtkDataArray*> vectors);
virtual vector<avtMaterial*> ExchangeMaterial(vector<int> domainNum,
vector<avtMaterial*> mats);
virtual std::vector<avtMaterial*> ExchangeMaterial(std::vector<int> domainNum,
std::vector<avtMaterial*> mats);
virtual vector<avtMixedVariable*> ExchangeMixVar(vector<int> domainNum,
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars);
virtual std::vector<avtMixedVariable*> ExchangeMixVar(std::vector<int> domainNum,
const std::vector<avtMaterial*> mats,
std::vector<avtMixedVariable*> mixvars);
// These are inherited and have real implementations.
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes,
vector<int> &allDomains);
virtual void CreateGhostNodes(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes,
std::vector<int> &allDomains);
virtual bool CanOnlyCreateGhostNodes(void)
{ return true; };
virtual bool RequiresCommunication(avtGhostDataType);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual bool ConfirmMesh(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes);
virtual void ResetCachedMembers(void) {;};
// These are unique to this class
......@@ -149,10 +148,10 @@ class DATABASE_API avtNekDomainBoundaries : public avtDomainBoundaries
static int CompareFaces(const void *f0, const void *f1);
static int CompareFaceProcs(const void *f0, const void *f1);
void CreateNeighborList(const vector<int> &domainNum,
const vector<vtkDataSet*> &meshes);
void CreateNeighborList(const std::vector<int> &domainNum,
const std::vector<vtkDataSet*> &meshes);
int ExtractMatchingFaces(Face *faces, int nFaces,
vector<int> &aMatchedFaces,
std::vector<int> &aMatchedFaces,
bool bCompressFaces);
......
......@@ -48,6 +48,8 @@
#include <avtDomainBoundaries.h>
#include <visitstream.h>
#include <vector>
// Forward declaration.
class DATABASE_API avtStructuredDomainBoundaries;
......@@ -94,7 +96,7 @@ struct Boundary
int domain;
int expand[6];
vector<Neighbor> neighbors;
std::vector<Neighbor> neighbors;
// old extents
int oldnextents[6];
int oldzextents[6];
......@@ -113,7 +115,7 @@ struct Boundary
// Creation methods
void SetExtents(int[6]);
void AddNeighbor(int,int,int[3],int[6]);
void DeleteNeighbor(int, vector<Boundary> &);
void DeleteNeighbor(int, std::vector<Boundary> &);
void Finish();
// Utility methods
bool IsGhostZone(int,int);
......@@ -149,15 +151,15 @@ class BoundaryHelperFunctions
T ***InitializeBoundaryData();
void FillBoundaryData(int, const T*, T***, bool, int=1);
void FillMixedBoundaryData(int,avtMaterial*,const T*,T***,int***,int***,vector<int>&);
void FillMixedBoundaryData(int,avtMaterial*,const T*,T***,int***,int***,std::vector<int>&);
void FillRectilinearBoundaryData(int, const T*, const T*, const T*, T***);
void CommunicateBoundaryData(const vector<int>&, T***, bool, int=1);
void CommunicateMixedBoundaryData(const vector<int>&,T***,int***,int***,vector< vector<int> > &);
void CommunicateBoundaryData(const std::vector<int>&, T***, bool, int=1);
void CommunicateMixedBoundaryData(const std::vector<int>&,T***,int***,int***,std::vector< std::vector<int> > &);
void CopyOldValues(int, const T*, T*, bool, int=1);
void CopyOldMixedValues(avtMaterial*,const T*, T*);
void CopyOldRectilinearValues(int, const T*, T*, int);
void SetNewBoundaryData(int, T***, T*, bool, int=1);
void SetNewMixedBoundaryData(int,avtMaterial*,const vector< vector<int> >&,int***,T***,int***,int***,int*,T*,int*,int*,int*,int&);
void SetNewMixedBoundaryData(int,avtMaterial*,const std::vector< std::vector<int> >&,int***,T***,int***,int***,int*,T*,int*,int*,int*,int&);
void SetNewRectilinearBoundaryData(int, T***, T*, T*, T*);
void FakeNonexistentBoundaryData(int, T*, bool, int=1);
void FreeBoundaryData(T***);
......@@ -254,60 +256,60 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
void GetNeighborPresence(int domain, bool *hasNeighbor,
std::vector<int> &);
vector<Neighbor> GetNeighbors(int domain);
std::vector<Neighbor> GetNeighbors(int domain);
virtual vector<vtkDataArray*> ExchangeScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
std::vector<vtkDataArray*> scalars);
virtual vector<vtkDataArray*> ExchangeFloatVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeFloatVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
std::vector<vtkDataArray*> vectors);
virtual vector<vtkDataArray*> ExchangeIntVector(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeIntVector(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> vectors);
std::vector<vtkDataArray*> vectors);
virtual vector<avtMaterial*> ExchangeMaterial(vector<int> domainNum,
vector<avtMaterial*> mats);
virtual std::vector<avtMaterial*> ExchangeMaterial(std::vector<int> domainNum,
std::vector<avtMaterial*> mats);
virtual vector<avtMixedVariable*> ExchangeMixVar(vector<int> domainNum,
const vector<avtMaterial*> mats,
vector<avtMixedVariable*> mixvars);
virtual std::vector<avtMixedVariable*> ExchangeMixVar(std::vector<int> domainNum,
const std::vector<avtMaterial*> mats,
std::vector<avtMixedVariable*> mixvars);
virtual void CreateGhostNodes(vector<int> domainNum,
vector<vtkDataSet*> meshes,
vector<int> &);
virtual void CreateGhostNodes(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes,
std::vector<int> &);
virtual bool RequiresCommunication(avtGhostDataType);
virtual bool ConfirmMesh(vector<int> domainNum,
vector<vtkDataSet*> meshes);
virtual bool ConfirmMesh(std::vector<int> domainNum,
std::vector<vtkDataSet*> meshes);
virtual void ResetCachedMembers();
private:
virtual vector<vtkDataArray*> ExchangeFloatScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeFloatScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
std::vector<vtkDataArray*> scalars);
virtual vector<vtkDataArray*> ExchangeIntScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeIntScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
std::vector<vtkDataArray*> scalars);
virtual vector<vtkDataArray*> ExchangeUCharScalar(vector<int> domainNum,
virtual std::vector<vtkDataArray*> ExchangeUCharScalar(std::vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
std::vector<vtkDataArray*> scalars);
protected:
// data
vector<Boundary> wholeBoundary;
vector<Boundary> boundary;
std::vector<Boundary> wholeBoundary;
std::vector<Boundary> boundary;
// data for cases where neighbors can be computed
bool shouldComputeNeighborsFromExtents;
vector<int> extents;
vector<int> levels;
vector<int> domain2proc;
std::vector<int> extents;
std::vector<int> levels;
std::vector<int> domain2proc;
int maxAMRLevel;
bool haveCalculatedBoundaries;
......@@ -320,8 +322,8 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
BoundaryHelperFunctions<unsigned char> *bhf_uchar;
// helper methods
vector<int> CreateDomainToProcessorMap(const vector<int>&);