Commit 791c6777 authored by hrchilds's avatar hrchilds
Browse files

Update from March 10, 2005

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@429 18c085ea-50e0-402c-830e-de6fd14e8384
parent c5b5865d
......@@ -23,6 +23,15 @@
static void RemovePrependedDirs(const char *, char *);
static char executableName[256];
static char componentName[256];
static const char *const allComponentNames[] = {
"avtprep",
"cli",
"engine",
"gui",
"launcher",
"mdserver",
"viewer"
};
static ErrorFunction errorFunction = NULL;
static void *errorFunctionArgs = NULL;
......@@ -267,6 +276,41 @@ Init::GetComponentName(void)
return (const char *) componentName;
}
// ****************************************************************************
// Function: Init::ComponentNameToID
//
// Purpose: Return integer index of component name in list of all components
//
// ****************************************************************************
const int
Init::ComponentNameToID(const char *compName)
{
int n = sizeof(allComponentNames) / sizeof(allComponentNames[0]);
for (int i = 0; i < n; i++)
{
if (strcmp(compName, allComponentNames[i]) == 0)
return i;
}
return -1;
}
// ****************************************************************************
// Function: Init::ComponentNameToID
//
// Purpose: Return name of component with given index in list of all components
//
// ****************************************************************************
const char*
Init::ComponentIDToName(const int id)
{
int n = sizeof(allComponentNames) / sizeof(allComponentNames[0]);
if (id >= 0 && id < n)
return allComponentNames[id];
else
return "unknown";
}
// ****************************************************************************
// Function: Init::IsComponent
//
......
......@@ -27,6 +27,9 @@ typedef void (*ErrorFunction)(void *, const char *);
// Hank Childs, Tue Jun 1 11:47:36 PDT 2004
// Added Finalize (should I have renamed this namespace?).
//
// Mark C. Miller, Tue Mar 8 18:06:19 PST 2005
// Added ComponentNameToID and ComponentIDToName
//
// ****************************************************************************
namespace Init
......@@ -36,6 +39,8 @@ namespace Init
MISC_API void SetComponentName(const char *);
MISC_API const char * GetExecutableName();
MISC_API const char * GetComponentName();
MISC_API const int ComponentNameToID(const char *);
MISC_API const char * ComponentIDToName(const int);
MISC_API bool IsComponent(const char *);
MISC_API void ComponentIssueError(const char *);
MISC_API void ComponentRegisterErrorFunction(ErrorFunction, void *);
......
......@@ -303,6 +303,7 @@ SRC= AnimationAttributes.C \
Point.C \
PointAttributes.C \
PrinterAttributes.C \
ProcessAttributes.C \
QueryAttributes.C \
QueryList.C \
QueryOverTimeAttributes.C \
......
#include <ProcessAttributes.h>
#include <DataNode.h>
// ****************************************************************************
// Method: ProcessAttributes::ProcessAttributes
//
// Purpose:
// Constructor for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
ProcessAttributes::ProcessAttributes() : AttributeSubject("d*d*s*b")
{
isParallel = false;
}
// ****************************************************************************
// Method: ProcessAttributes::ProcessAttributes
//
// Purpose:
// Copy constructor for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
ProcessAttributes::ProcessAttributes(const ProcessAttributes &obj) : AttributeSubject("d*d*s*b")
{
pids = obj.pids;
ppids = obj.ppids;
hosts = obj.hosts;
isParallel = obj.isParallel;
SelectAll();
}
// ****************************************************************************
// Method: ProcessAttributes::~ProcessAttributes
//
// Purpose:
// Destructor for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
ProcessAttributes::~ProcessAttributes()
{
// nothing here
}
// ****************************************************************************
// Method: ProcessAttributes::operator =
//
// Purpose:
// Assignment operator for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
ProcessAttributes&
ProcessAttributes::operator = (const ProcessAttributes &obj)
{
if (this == &obj) return *this;
pids = obj.pids;
ppids = obj.ppids;
hosts = obj.hosts;
isParallel = obj.isParallel;
SelectAll();
return *this;
}
// ****************************************************************************
// Method: ProcessAttributes::operator ==
//
// Purpose:
// Comparison operator == for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
bool
ProcessAttributes::operator == (const ProcessAttributes &obj) const
{
// Create the return value
return ((pids == obj.pids) &&
(ppids == obj.ppids) &&
(hosts == obj.hosts) &&
(isParallel == obj.isParallel));
}
// ****************************************************************************
// Method: ProcessAttributes::operator !=
//
// Purpose:
// Comparison operator != for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
bool
ProcessAttributes::operator != (const ProcessAttributes &obj) const
{
return !(this->operator == (obj));
}
// ****************************************************************************
// Method: ProcessAttributes::TypeName
//
// Purpose:
// Type name method for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
const std::string
ProcessAttributes::TypeName() const
{
return "ProcessAttributes";
}
// ****************************************************************************
// Method: ProcessAttributes::CopyAttributes
//
// Purpose:
// CopyAttributes method for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
bool
ProcessAttributes::CopyAttributes(const AttributeGroup *atts)
{
if(TypeName() != atts->TypeName())
return false;
// Call assignment operator.
const ProcessAttributes *tmp = (const ProcessAttributes *)atts;
*this = *tmp;
return true;
}
// ****************************************************************************
// Method: ProcessAttributes::CreateCompatible
//
// Purpose:
// CreateCompatible method for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
ProcessAttributes::CreateCompatible(const std::string &tname) const
{
AttributeSubject *retval = 0;
if(TypeName() == tname)
retval = new ProcessAttributes(*this);
// Other cases could go here too.
return retval;
}
// ****************************************************************************
// Method: ProcessAttributes::NewInstance
//
// Purpose:
// NewInstance method for the ProcessAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
AttributeSubject *
ProcessAttributes::NewInstance(bool copy) const
{
AttributeSubject *retval = 0;
if(copy)
retval = new ProcessAttributes(*this);
else
retval = new ProcessAttributes;
return retval;
}
// ****************************************************************************
// Method: ProcessAttributes::SelectAll
//
// Purpose:
// Selects all attributes.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
void
ProcessAttributes::SelectAll()
{
Select(0, (void *)&pids);
Select(1, (void *)&ppids);
Select(2, (void *)&hosts);
Select(3, (void *)&isParallel);
}
///////////////////////////////////////////////////////////////////////////////
// Set property methods
///////////////////////////////////////////////////////////////////////////////
void
ProcessAttributes::SetPids(const doubleVector &pids_)
{
pids = pids_;
Select(0, (void *)&pids);
}
void
ProcessAttributes::SetPpids(const doubleVector &ppids_)
{
ppids = ppids_;
Select(1, (void *)&ppids);
}
void
ProcessAttributes::SetHosts(const stringVector &hosts_)
{
hosts = hosts_;
Select(2, (void *)&hosts);
}
void
ProcessAttributes::SetIsParallel(bool isParallel_)
{
isParallel = isParallel_;
Select(3, (void *)&isParallel);
}
///////////////////////////////////////////////////////////////////////////////
// Get property methods
///////////////////////////////////////////////////////////////////////////////
const doubleVector &
ProcessAttributes::GetPids() const
{
return pids;
}
doubleVector &
ProcessAttributes::GetPids()
{
return pids;
}
const doubleVector &
ProcessAttributes::GetPpids() const
{
return ppids;
}
doubleVector &
ProcessAttributes::GetPpids()
{
return ppids;
}
const stringVector &
ProcessAttributes::GetHosts() const
{
return hosts;
}
stringVector &
ProcessAttributes::GetHosts()
{
return hosts;
}
bool
ProcessAttributes::GetIsParallel() const
{
return isParallel;
}
///////////////////////////////////////////////////////////////////////////////
// Select property methods
///////////////////////////////////////////////////////////////////////////////
void
ProcessAttributes::SelectPids()
{
Select(0, (void *)&pids);
}
void
ProcessAttributes::SelectPpids()
{
Select(1, (void *)&ppids);
}
void
ProcessAttributes::SelectHosts()
{
Select(2, (void *)&hosts);
}
///////////////////////////////////////////////////////////////////////////////
// Keyframing methods
///////////////////////////////////////////////////////////////////////////////
// ****************************************************************************
// Method: ProcessAttributes::GetFieldName
//
// Purpose:
// This method returns the name of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
std::string
ProcessAttributes::GetFieldName(int index) const
{
switch (index)
{
case 0: return "pids";
case 1: return "pids";
case 2: return "hosts";
case 3: return "isParallel";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: ProcessAttributes::GetFieldType
//
// Purpose:
// This method returns the type of a field given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
AttributeGroup::FieldType
ProcessAttributes::GetFieldType(int index) const
{
switch (index)
{
case 0: return FieldType_doubleVector;
case 1: return FieldType_doubleVector;
case 2: return FieldType_stringVector;
case 3: return FieldType_bool;
default: return FieldType_unknown;
}
}
// ****************************************************************************
// Method: ProcessAttributes::GetFieldTypeName
//
// Purpose:
// This method returns the name of a field type given its index.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
std::string
ProcessAttributes::GetFieldTypeName(int index) const
{
switch (index)
{
case 0: return "doubleVector";
case 1: return "doubleVector";
case 2: return "stringVector";
case 3: return "bool";
default: return "invalid index";
}
}
// ****************************************************************************
// Method: ProcessAttributes::FieldsEqual
//
// Purpose:
// This method compares two fields and return true if they are equal.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
bool
ProcessAttributes::FieldsEqual(int index_, const AttributeGroup *rhs) const
{
const ProcessAttributes &obj = *((const ProcessAttributes*)rhs);
bool retval = false;
switch (index_)
{
case 0:
{ // new scope
retval = (pids == obj.pids);
}
break;
case 1:
{ // new scope
retval = (ppids == obj.ppids);
}
break;
case 2:
{ // new scope
retval = (hosts == obj.hosts);
}
break;
case 3:
{ // new scope
retval = (isParallel == obj.isParallel);
}
break;
default: retval = false;
}
return retval;
}
///////////////////////////////////////////////////////////////////////////////
// User-defined methods.
///////////////////////////////////////////////////////////////////////////////
#ifndef PROCESSATTRIBUTES_H
#define PROCESSATTRIBUTES_H
#include <state_exports.h>
#include <string>
#include <AttributeSubject.h>
// ****************************************************************************
// Class: ProcessAttributes
//
// Purpose:
// attributes to describe a running process
//
// Notes: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: Wed Mar 9 07:12:22 PDT 2005
//
// Modifications:
//
// ****************************************************************************
class STATE_API ProcessAttributes : public AttributeSubject
{
public:
ProcessAttributes();
ProcessAttributes(const ProcessAttributes &obj);
virtual ~ProcessAttributes();
virtual ProcessAttributes& operator = (const ProcessAttributes &obj);
virtual bool operator == (const ProcessAttributes &obj) const;
virtual bool operator != (const ProcessAttributes &obj) const;
virtual const std::string TypeName() const;
virtual bool CopyAttributes(const AttributeGroup *);
virtual AttributeSubject *CreateCompatible(const std::string &) const;
virtual AttributeSubject *NewInstance(bool) const;