陈清红
2025-04-14 880f3c0257eeb8c37761d484258fdd102a369a19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Quintiq file version 2.0
#parent: #root
StaticMethod Create (LibOpt_ScopeThin scope, LibOpt_Group group, String type) as LibOpt_ScopeShared
{
  Description: 'Create a `LibOpt_ScopeShared` with only one `LibOpt_Scope` associated with it.'
  TextBody:
  [*
    result := null( LibOpt_ScopeShared );
    
    group_vector := null( NumberVector );
    if( isnull( group ) )
    {
      group_vector := NumberVector::Construct( 0 );
    }
    else
    {
      group_vector := NumberVector::Construct( scope.ID() + 1 );
      group_vector.Set( scope.ID(), group.ID() );
    }
    
    if( scope.Index() = 0 )
    {
      result := scope.ScopeSharedOwned( relnew, LibOpt_ScopeShared32,
                                        Set := LibOpt_ScopeShared32::GetSetID( scope ),
                                        Type := type,
                                        GroupVector := group_vector.AsBinaryValue() );
    }
    else
    {
      result := scope.ScopeSharedOwned( relnew, LibOpt_ScopeSharedVector,
                                        Set := LibOpt_ScopeSharedVector::GetSetID( scope ),
                                        Type := type,
                                        GroupVector := group_vector.AsBinaryValue() );
    }
    
    LibOpt_ScopeSharedOnScope::Create( scope, group, result );
    
    return result;
  *]
  InterfaceProperties { Accessibility: 'Module' }
}