Skip to content

Commit

Permalink
chore: Fixed misunderstanding. Plain DC fields are attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrdz committed Feb 21, 2024
1 parent 85edb1c commit 96285bc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 59 deletions.
49 changes: 0 additions & 49 deletions libdonet/src/dcattribute.rs

This file was deleted.

11 changes: 5 additions & 6 deletions libdonet/src/dcfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use crate::datagram::Datagram;
use crate::dcatomic::DCAtomicField;
use crate::dcattribute::DCAttributeField;
use crate::dckeyword::{DCKeywordList, DCKeywordListInterface, IdentifyKeyword};
use crate::dclass::DClass;
use crate::dcmolecular::DCMolecularField;
Expand All @@ -29,7 +28,7 @@ use std::sync::{Arc, Mutex};

/// A field of a Distributed Class. The DCField struct is a base for
/// struct and dclass fields. In the DC language, there are three types
/// of field declarations, which are: attribute, atomic, and molecular.
/// of field declarations, which are: plain fields, atomic, and molecular.
#[derive(Debug)]
pub struct DCField {
keyword_list: DCKeywordList,
Expand All @@ -48,8 +47,8 @@ pub struct DCField {
/// Enumerator representing the 3 types of fields that inherit DC Field,
/// which can legally be declared within a Distributed Class.
///
/// DC Attribute Fields represent a property, or member, of a structure
/// or class. Attribute fields have a data type assigned to them.
/// Plain DC Fields represent a property, or member, of a structure
/// or class. DC fields have a data type assigned to them.
///
/// DC Atomic Fields represent a method of a Distributed Class, which
/// is always implemented as a remote procedure call (RPC). Unlike
Expand All @@ -62,7 +61,7 @@ pub struct DCField {
/// when the molecular field was declared.
#[derive(Debug)]
pub enum ClassField {
Attribute(DCAttributeField),
Field(DCField),
Atomic(DCAtomicField),
Molecular(DCMolecularField),
}
Expand All @@ -71,7 +70,7 @@ pub enum ClassField {
/// for DC Structs, since they cannot contain DC Atomic Fields.
#[derive(Debug)]
pub enum StructField {
Attribute(DCAttributeField),
Field(DCField),
Molecular(DCMolecularField),
}

Expand Down
5 changes: 2 additions & 3 deletions libdonet/src/dclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

use crate::dcatomic::{DCAtomicField, DCAtomicFieldInterface};
use crate::dcattribute::DCAttributeFieldInterface;
use crate::dcfield::ClassField;
use crate::dcfield::{ClassField, DCFieldInterface};
use crate::globals;
use crate::hashgen::DCHashGenerator;
use multimap::MultiMap;
Expand Down Expand Up @@ -98,7 +97,7 @@ impl DClassInterface for DClass {
let field: MutexGuard<'_, ClassField> = new_ptr.deref().lock().unwrap();

match &field.deref() {
ClassField::Attribute(attribute) => attribute.generate_hash(hashgen),
ClassField::Field(field) => field.generate_hash(hashgen),
ClassField::Atomic(atomic) => atomic.generate_hash(hashgen),
ClassField::Molecular(_) => todo!(),
}
Expand Down
1 change: 0 additions & 1 deletion libdonet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ cfg_if! {
if #[cfg(feature = "dcfile")] {
pub mod dcarray;
pub mod dcatomic;
pub mod dcattribute;
pub mod dcfield;
pub mod dcfile;
pub mod dckeyword;
Expand Down

0 comments on commit 96285bc

Please sign in to comment.