Version: 9.12.0
datamodeler.DataModeler Class Reference

This class is a placeholder for modeling data. More...

Inheritance diagram for datamodeler.DataModeler:

Public Member Functions

def __init__ (self, typemap=None, rangemap=None, defaultmap=None, voidmap=None)
 
def addAttribute (self, name, a_type=None, a_range=None, default=None, void=None)
 A None argument means that no entry is created in the associated maps. More...
 
def __setattr__ (self, name, val)
 
def __getattribute__ (self, name)
 
def log (self)
 

Private Member Functions

def __isNotValidType (self, name, val)
 
def __isNotValidRange (self, name, val)
 
def __isVoidAllowed (self, name)
 

Private Attributes

 _typemap
 
 _rangemap
 
 _defaultmap
 
 _voidmap
 

Detailed Description

This class is a placeholder for modeling data.

An object based on this class (particular instance or specialized derived class) can defined attributes with the following properties:

  • a type : the class or the type of the attribute. Setting an attribute to a value whose type is not the specified type raises an exception.
  • a range : a list of the possible values for the attribute. Setting an attribute to a value not in the range raises an exception
  • a default: the default value of an attribute when an instance is created
  • a void flag: the attribute can be authorized to be None or not using this flag. Setting an attribute to a None value while the flag is not set to True raises an exception. By default, a None value is not allowed.

These properties are dictionnaries mapping the attribute name to its associated value for the property.
A typical usage is to derived this class in a specialized form where the attributes names and there properties are defined in the constructor. See use cases at the end of this file.

Constructor & Destructor Documentation

◆ __init__()

def datamodeler.DataModeler.__init__ (   self,
  typemap = None,
  rangemap = None,
  defaultmap = None,
  voidmap = None 
)

Member Function Documentation

◆ __getattribute__()

def datamodeler.DataModeler.__getattribute__ (   self,
  name 
)

◆ __isNotValidRange()

def datamodeler.DataModeler.__isNotValidRange (   self,
  name,
  val 
)
private

◆ __isNotValidType()

def datamodeler.DataModeler.__isNotValidType (   self,
  name,
  val 
)
private

◆ __isVoidAllowed()

def datamodeler.DataModeler.__isVoidAllowed (   self,
  name 
)
private

◆ __setattr__()

◆ addAttribute()

def datamodeler.DataModeler.addAttribute (   self,
  name,
  a_type = None,
  a_range = None,
  default = None,
  void = None 
)

◆ log()

def datamodeler.DataModeler.log (   self)

Field Documentation

◆ _defaultmap

datamodeler.DataModeler._defaultmap
private

◆ _rangemap

◆ _typemap

◆ _voidmap