[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

4939.0. "Polling all readers..." by MOLAR::DFLAT::PLOUFFE (Jerry) Thu Apr 22 1993 12:51

  Question:

    Does anyone out there use SUBRANGES of ENUMERATIONS?  Does anyone see any
    use for this kind of datatype?

  We need to know in order to determine whether to support this capability
  in our new MSL Translator / Dictionary Subsystem.

  Please post replies here...

                                                                         - Jerry

  P.S. Please speak now or forever hold you peace!! ;)
T.RTitleUserPersonal
Name
DateLines
4939.1You Bet.RACER::daveAhh, but fortunately, I have the key to escape reality.Fri Apr 23 1993 11:5847
Absolutly,  And you know it........

 I would like to use them in a number of places, but the current
	MSL/Dictionary implementation leaves a lot to be desired.

	An example:

		Object X has a privelege enumeration, a,b,c,d,e,f,g,h

		Object Y, a child of X only supports a subset of the 
		enumeration, and hence, we would like to define this
		as a subrange of the enumeration that X is using.

	In addition, (and the reason the current set is broken), is that
	the bit values used in the subrange should match those used in the 
	original enumeration

From my MSL...

TYPE SideLifecycleStates                =  107  (
        Purchased                       =       2,
        Scratch                         =       3,
        Assigned                        =       4,
        Released                        =       5,
        Discarded                       =       6,
        Exported                        =       7,
        To Be Imported                  =       8);

TYPE CreateSideStates                   =  108  (
        Purchased                       =       2,
        Exported                        =       7,
        To Be Imported                  =       8);

the second def should be....

TYPE CreateSideStates                   =  108  CartLifecycleStates [2,7..8];

As all these object are supported by the same code module,
it is really important that the bits used match.  Note that they currently dont.

The first should used bits 0..6, and the second should use
bits 0, and 5..6.

While your at it, make subrange for string datatypes, work, too.
The SRM claims support for all string datatypes, but the code only
really supports Latin1String.

4939.2Thanks for your response...MOLAR::DFLAT::PLOUFFEJerryFri Apr 23 1993 15:4017
Dave:

  I have a couple of questions:

    o What priority (high, medium, low) would you assign to the need for 
      SUBRANGE of ENUMERATION?

    o After studying your example I have to ask why 'CreateSideStates' is
      defined as a TYPE.  What objects are assigned this type in your MSL
      example?  Can you explain the real example more fully?   

  Sorry to bother you so much, but we need real justification to invest in this 
  area and I want to make sure that I fully understand your example.

  Thanks in advance...

                                                                        - Jerry
4939.3RACER::daveAhh, but fortunately, I have the key to escape reality.Fri Apr 23 1993 17:3653
The actual data objects are states that use these enumerations.

These are defined as types to make the maintainance of the MSL LOTS more straight-
forward.

ALL of the attributes in our MSL are defined as abstracted types, making
changes much more simple.  The current MSL is about as big as the current
set of Phase 5 MSL.

The more common use is as a BITSET of the enumeration, where many different
rights are granted, as in....



For me, priority is Medium, for you, probably lower.

Another (FULL) example:



TYPE BranchMediaLibraryPolicies         =  300  (
        Vol Name Same as Cart Side 1    =       0,
        Import Name Exceptions Prohibited =     1,
        Owner Initiated Export Prohibited =     2,
        Unlabeled Media Prohibited      =       3,
        Unlabeled Media Prohibited With Import Exceptions =     4,
        Defer Prepare Until Load        =       5,
        Truncate on Prepare             =       6,
        Initialize on Prepare           =       7,
        Erase on Prepare                =       8,
        Assign All Base Sides at Once   =       9,
        Assign All Compound Sides at Once =     10,
        Erase on Discard                =       11,
        Owner Relocate Prohibited       =       12,
        Prohibit Scratching Individual Cartridge Sides =        13);

TYPE CartPolicies                       =  301  BranchMediaLibraryPolicies
                                                        [2,5..13];

TYPE SidePolicies                       =  302  BranchMediaLibraryPolicies
                                                        [5..8,11];

TYPE BranchMediaLibraryPolicySet        =  400  BITSET OF BranchMediaLibraryPolicies;
TYPE CartPolicySet                      =  401  BITSET OF CartPolicies;
TYPE SidePolicySet                      =  402  BITSET OF SidePolicies;

It is important that all the "bits" in these masks "line up" as it makes
the code lots more simple to deal with.

Also...

TYPE CartNameTemplate                   =   31  Latin1String
                        [32..34,37..63,65..90,95..95,97..102];