HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
STY_TargetMatchClosure.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: STY_TargetMatchClosure.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_TargetMatchClosure__
12 #define __STY_TargetMatchClosure__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 #include "STY_BindingDataSource.h"
17 #include <UT/UT_StringMap.h>
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_IntrusivePtr.h>
20 
21 class UT_StringArray;
22 
23 /// Class containing information about data associated with a style subject
24 /// match to a style target. It contains concrete data provided by the subject,
25 /// such as data for script input argument binding, etc.
27  public UT_NonCopyable,
28  public UT_IntrusiveRefCounter<STY_TargetMatchClosure>
29 {
30 public:
31  /// Constructor.
33  const STY_TargetMatchClosureHandle &parent_closure );
34 
35  /// Registers an override binding data source for a given data name.
36  void addOverrideBindingDataSource(const UT_StringHolder &entry_name,
37  const STY_BindingDataSourceHandle &data_source);
38 
39  /// Returns a data source given the data name for override script
40  /// input argument binding.
42  findOverrideBindingDataSource(
43  const UT_StringHolder &entry_name) const;
44 
45  /// Returns all bindings in the closure (or any parent closures).
46  void getBindingDataSourceNames(UT_StringArray &entry_names) const;
47 
48 private:
49  /// A table of data sources for a given data name.
50  UT_StringMap<STY_BindingDataSourceHandle> myBindingDataSources;
51 
52  /// Parent closure constructed from previous partial matches of
53  /// sub-targets, if any.
54  STY_TargetMatchClosureHandle myParentClosure;
55 };
56 
57 #endif
58 
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.