SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
List of all members
StateAccessor.StateAccessor Class Reference

This is a helper class for custom members. More...

Inheritance diagram for StateAccessor.StateAccessor:
HashingComponent.HashingComponent JoistMemberCore.JoistManufacturer.JoistBIMBase JoistMemberCore.JoistManufacturer.JoistSetupBase UnreadableComponentProxy.UnreadableComponentProxy

Methods defined here:

def __convert__
def __getstate__
def __init__
def __setstate__

Data descriptors defined here:

def __dict__
 dictionary for instance variables (if defined)
def __weakref__
 list of weak references to the object (if defined)

Data and other attributes defined here:

 __getstate_manages_dict__ = True

Detailed Description

This is a helper class for custom members.

Inherit from this class before inheriting from MemberBase: Set _arguments as a class object. It should be a dictionary which contains lists of tuples. Each tuple in the list is a name and a default value. These names will become properties on your member object. The key for the dictionary should be your current version.

You'll have one list of lists for every version of your member that you currently support reading. So, when you want to add something, remove something, or change something increment your version and start a new list.

When you want to change the meaning of a field, you can override the convert method.

Objects contained within your StateAccessor Memberbase object should derive from StateAccessor and DummyBase.

Example: import math from MemberBase import MemberBase from StateAccessor import StateAccessor, DummyBase

class ExampleMember( StateAccessor, MemberBase ): _version = 2 _arguments = {} _arguments[ 0 ] = ( ('one', 1), ('angle', 180.) ) _arguments[ 1 ] = ( ('one', 1), ('angle', math.pi) ) _arguments[ 2 ] = ( ('one', 1), ('angle', math.pi), ('ends', [ExampleMemberEnd(),ExampleMemberEnd()] ) )

def convert( self, old_version ): if old_version == 0: self.angle = math.radians( self.angle )

class ExampleMemberEnd( StateAccessor, DummyBase ): _version = 0 _arguments = {} _arguments[0] = (('end_angle',math.pi),)

Constructor & Destructor Documentation

def StateAccessor.StateAccessor.__init__ (   args)

Member Function Documentation

def StateAccessor.StateAccessor.__convert__ (   args)
def StateAccessor.StateAccessor.__dict__ (   args)
def StateAccessor.StateAccessor.__getstate__ (   args)
def StateAccessor.StateAccessor.__setstate__ (   args)
def StateAccessor.StateAccessor.__weakref__ (   args)

Member Data Documentation

StateAccessor.StateAccessor.__getstate_manages_dict__ = True
staticprivate