Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
bc6c00928c
2 changed files with 97 additions and 0 deletions
  1. 61 0
      direct/src/dcparse/dcField.cxx
  2. 36 0
      direct/src/dcparse/dcField.h

+ 61 - 0
direct/src/dcparse/dcField.cxx

@@ -0,0 +1,61 @@
+// Filename: dcField.cxx
+// Created by:  drose (11Oct00)
+// 
+////////////////////////////////////////////////////////////////////
+
+#include "dcField.h"
+
+////////////////////////////////////////////////////////////////////
+//     Function: DCField::get_number
+//       Access: Public
+//  Description: Returns a unique index number associated with this
+//               field.  This is defined implicitly when the .dc
+//               file(s) are read.
+////////////////////////////////////////////////////////////////////
+int DCField::
+get_number() const {
+  return _number;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: DCField::get_name
+//       Access: Public
+//  Description: Returns the name of this field.
+////////////////////////////////////////////////////////////////////
+const string &DCField::
+get_name() const {
+  return _name;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: DCField::as_atomic_field
+//       Access: Public, Virtual
+//  Description: Returns the same field pointer converted to an atomic
+//               field pointer, if this is in fact an atomic field;
+//               otherwise, returns NULL.
+////////////////////////////////////////////////////////////////////
+DCAtomicField *DCField::
+as_atomic_field() {
+  return (DCAtomicField *)NULL;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: DCField::as_molecular_field
+//       Access: Public, Virtual
+//  Description: Returns the same field pointer converted to a
+//               molecular field pointer, if this is in fact a
+//               molecular field; otherwise, returns NULL.
+////////////////////////////////////////////////////////////////////
+DCMolecularField *DCField::
+as_molecular_field() {
+  return (DCMolecularField *)NULL;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: DCField::Destructor
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+DCField::
+~DCField() {
+}

+ 36 - 0
direct/src/dcparse/dcField.h

@@ -0,0 +1,36 @@
+// Filename: dcField.h
+// Created by:  drose (11Oct00)
+// 
+////////////////////////////////////////////////////////////////////
+
+#ifndef DCFIELD_H
+#define DCFIELD_H
+
+#include "dcbase.h"
+
+class DCAtomicField;
+class DCMolecularField;
+
+////////////////////////////////////////////////////////////////////
+// 	 Class : DCField
+// Description : A single field of a Distributed Class, either atomic
+//               or molecular.
+////////////////////////////////////////////////////////////////////
+class DCField {
+PUBLISHED:
+  int get_number() const;
+  const string &get_name() const;
+
+  virtual DCAtomicField *as_atomic_field();
+  virtual DCMolecularField *as_molecular_field();
+
+public:
+  virtual ~DCField();
+  virtual void write(ostream &out, int indent_level = 0) const=0;
+
+public:
+  int _number;
+  string _name;
+};
+
+#endif