ECReportNode.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
15 
16 DGNPLATFORM_TYPEDEFS(ECReportNode)
17 DGNPLATFORM_REF_COUNTED_PTR(ECReportNode)
18 DGNPLATFORM_TYPEDEFS(SortingGroupNode)
19 DGNPLATFORM_REF_COUNTED_PTR(SortingGroupNode)
20 DGNPLATFORM_TYPEDEFS(ColumnGroupNode)
21 DGNPLATFORM_REF_COUNTED_PTR(ColumnGroupNode)
22 DGNPLATFORM_TYPEDEFS(ReportDefinitionNode)
23 DGNPLATFORM_REF_COUNTED_PTR(ReportDefinitionNode)
24 DGNPLATFORM_TYPEDEFS(ReportCategoryNode)
25 DGNPLATFORM_REF_COUNTED_PTR(ReportCategoryNode)
26 DGNPLATFORM_TYPEDEFS(ColumnDefinitionNode)
27 DGNPLATFORM_REF_COUNTED_PTR(ColumnDefinitionNode)
28 DGNPLATFORM_TYPEDEFS(SortingRuleNode)
29 DGNPLATFORM_REF_COUNTED_PTR(SortingRuleNode)
30 DGNPLATFORM_TYPEDEFS(DgnECHost)
31 DGNPLATFORM_TYPEDEFS(DgnECHostIterable)
33 DGNPLATFORM_TYPEDEFS(HostExpressionContext)
34 DGNPLATFORM_REF_COUNTED_PTR(HostExpressionContext)
35 DGNPLATFORM_TYPEDEFS(HostExpressionCriterion)
36 DGNPLATFORM_REF_COUNTED_PTR(HostExpressionCriterion)
37 DGNPLATFORM_TYPEDEFS(ReportResultsRow)
38 DGNPLATFORM_TYPEDEFS(ReportResultsIterator)
39 DGNPLATFORM_REF_COUNTED_PTR(ReportResultsIterator)
40 DGNPLATFORM_TYPEDEFS(ReportResults)
41 DGNPLATFORM_TYPEDEFS(ReportResultsEntry)
42 DGNPLATFORM_TYPEDEFS(DgnECHostSpecification)
43 DGNPLATFORM_TYPEDEFS(DgnECHostSpecificationsContext)
44 DGNPLATFORM_TYPEDEFS(DgnECHostRelationshipSpecification)
45 DGNPLATFORM_TYPEDEFS(ReportScope)
46 DGNPLATFORM_TYPEDEFS(ReportColumnAccessor)
47 
48 
50 
51 /*---------------------------------------------------------------------------------**/
55 enum class ECReportNodeType : UInt8
56  {
57  Unknown = 0,
58  Category = 1 << 0,
59  ReportDefinition = 1 << 1,
60  ColumnGroup = 1 << 2,
61  SortingGroup = 1 << 3,
62  ColumnDefinition = 1 << 4,
63  SortingRule = 1 << 5,
64  };
65 
66 typedef bvector<ECReportNodePtr> ECReportNodeList;
68 
69 
70 /*---------------------------------------------------------------------------------**/
76  {
78 public:
80  DGNPLATFORM_EXPORT ECReportNodePtr GetParentNode();
82  DGNPLATFORM_EXPORT ECReportNodeCP GetParentNode() const;
84  DGNPLATFORM_EXPORT ECReportNodeType GetNodeType() const;
86  DGNPLATFORM_EXPORT ECReportNodeListCP GetChildNodes() const;
88  DGNPLATFORM_EXPORT ECReportNodePtr GetChildByName (WCharCP name);
90  DGNPLATFORM_EXPORT WString GetDisplayLabel() const;
92  DGNPLATFORM_EXPORT DgnFileR GetDgnFile() const;
94  DGNPLATFORM_EXPORT ReportDefinitionNodePtr GetAssociatedReportDefinition() const;
95 
97  DGNPLATFORM_EXPORT static ECReportNodePtr FindByElementId (ElementId elemId, DgnFileR dgnfile);
99  DGNPLATFORM_EXPORT static ECReportNodePtr FindByElementId (ElementId elemId, XDataTreeOwnerR owner);
101  DGNPLATFORM_EXPORT static ECReportNodePtr FromXDataTreeNode (XDataTreeNodeR node);
102  };
103 
104 /*---------------------------------------------------------------------------------**/
110  {
111 private:
112  SortingRuleNode();
113 public:
114  DGNPLATFORM_EXPORT static SortingRuleNodePtr From (ECReportNodeR node);
115 
117  DGNPLATFORM_EXPORT WCharCP GetColumnName() const;
119  DGNPLATFORM_EXPORT bool IsAscending() const;
121  DGNPLATFORM_EXPORT bool IsCaseSensitive() const;
123  DGNPLATFORM_EXPORT bool ApplyBeforeFormatting() const;
125  DGNPLATFORM_EXPORT bool HideDuplicateValues() const;
126 
128  DGNPLATFORM_EXPORT bool SetColumnName (WCharCP name);
130  DGNPLATFORM_EXPORT bool SetAscending (bool asc);
132  DGNPLATFORM_EXPORT bool SetCaseSensitive (bool cs);
134  DGNPLATFORM_EXPORT bool SetApplyBeforeFormatting (bool apply);
136  DGNPLATFORM_EXPORT bool SetHideDuplicateValues (bool hide);
137 
138  };
139 
140 /*---------------------------------------------------------------------------------**/
146  {
147  /*---------------------------------------------------------------------------------**/
152  enum class ArrayOption : wchar_t
153  {
154  AllMembers = L'*',
155  First = L'^',
156  Last = L'$',
157  Count = L'#',
158  List = L',',
159  None = L'\0'
160  };
161 
162  /*---------------------------------------------------------------------------------**/
168  {
170  private:
171  WString m_memberAccessor;
172  Option m_option;
173  public:
175  ArrayAccessor (WCharCP memberAccessor, ReportColumnAccessor::ArrayOption memberArrayOption = ArrayOption::None) : m_memberAccessor (memberAccessor), m_option (memberArrayOption) { }
178 
180  WCharCP GetAccessString() const { return m_memberAccessor.c_str(); }
182  ReportColumnAccessor::ArrayOption GetOption() const { return m_option; }
183  };
184 
185  typedef bvector<ArrayAccessor> ArrayAccessorList;
186 private:
187  ECN::QualifiedECAccessor m_accessor;
188  ArrayOption m_arrayOption;
189  ArrayAccessorList m_arrayAccessors;
190 public:
192  ReportColumnAccessor() : m_arrayOption (ArrayOption::None) { }
194  ReportColumnAccessor (ECN::QualifiedECAccessorCR accessor, ArrayOption arrayOption = ArrayOption::None) : m_accessor (accessor), m_arrayOption (arrayOption) { }
196  ReportColumnAccessor (WCharCP schemaName, WCharCP className, WCharCP accessString, ArrayOption arrayOption = ArrayOption::None) : m_accessor (schemaName, className, accessString), m_arrayOption (arrayOption) { }
197 
199  ECN::QualifiedECAccessorCR GetAccessor() const { return m_accessor; }
201  ECN::QualifiedECAccessorR GetAccessor() { return m_accessor; }
203  ArrayOption GetArrayOption() const { return m_arrayOption; }
205  ArrayAccessorList const& GetArrayAccessors() const { return m_arrayAccessors; }
207  ArrayAccessorList& GetArrayAccessors() { return m_arrayAccessors; }
208 
209  };
210 
211 typedef bvector<ReportColumnAccessor> ReportColumnAccessorList;
213 
214 /*---------------------------------------------------------------------------------**/
222  {
223 private:
225 public:
227  DGNPLATFORM_EXPORT static ColumnDefinitionNodePtr From (ECReportNodeR node);
228 
230  DGNPLATFORM_EXPORT UInt32 GetNumAccessors() const;
232  DGNPLATFORM_EXPORT ReportColumnAccessorList GetAccessors() const;
234  DGNPLATFORM_EXPORT bool SetAccessors (ReportColumnAccessorListCR accessors);
235 
237  DGNPLATFORM_EXPORT ECN::IECInstancePtr GetFormattingOptions (bool createIfNotFound);
239  DGNPLATFORM_EXPORT ECN::IECInstanceCP GetFormattingOptions() const;
240 
242  DGNPLATFORM_EXPORT ECN::IECInstancePtr GetArraySortingOptions (bool createIfNotFound);
244  DGNPLATFORM_EXPORT ECN::IECInstanceCP GetArraySortingOptions() const;
245 
247  DGNPLATFORM_EXPORT WString GetListDelimiter() const;
249  DGNPLATFORM_EXPORT bool SetListDelimiter (WCharCP delimiter);
250 
251  };
252 
253 typedef bvector<SortingRuleNodePtr> SortingRuleList;
254 typedef bvector<ColumnDefinitionNodePtr> ColumnDefinitionList;
257 typedef bvector<ECN::SchemaNameClassNamePair> SchemaClassNameList;
260 
261 /*---------------------------------------------------------------------------------**/
268  {
269  /*---------------------------------------------------------------------------------**/
274  enum Flags
275  {
276  kFlag_Required = 1 << 0,
277  kFlag_Backward = 1 << 1,
278  kFlag_RelatedPolymorphic = 1 << 2,
279  kFlag_RelationshipPolymorphic = 1 << 3,
280 
281  kFlags_None = 0,
282  kFlags_Default = (kFlag_RelatedPolymorphic | kFlag_RelationshipPolymorphic)
283  };
284 private:
285  ECN::SchemaNameClassNamePair m_relationshipName;
286  ECN::SchemaNameClassNamePair m_relatedClassName;
288  Flags m_flags;
289  QueryRelatedClassSpecifierPtr m_querySpec;
290 
291  bool GetFlag (Flags flag) const { return 0 != (m_flags & flag); }
292  void SetFlag (Flags flag, bool set) { m_flags = (Flags)(set ? (m_flags | flag) : (m_flags & (~flag))); }
293 
294 public:
297  bool required=false, bool relationshipPolymorphic=true, bool relatedPolymorphic=true);
299  DGNPLATFORM_EXPORT DgnECHostRelationshipSpecification (DgnECHostRelationshipSpecificationCR rhs);
301  DgnECHostRelationshipSpecification() : m_related(nullptr), m_flags(kFlags_Default) { }
305  DGNPLATFORM_EXPORT DgnECHostRelationshipSpecification& operator=(DgnECHostRelationshipSpecificationCR rhs);
306 
308  ECN::SchemaNameClassNamePairCR GetRelationshipClass() const { return m_relationshipName; }
310  ECN::SchemaNameClassNamePairCR GetRelatedClass() const { return m_relatedClassName; }
312  DgnECHostRelationshipSpecificationCP GetNestedSpecification() const { return m_related; }
313 
315  bool IsRequired() const { return GetFlag (kFlag_Required); }
317  bool IsRelatedPolymorphic() const { return GetFlag (kFlag_RelatedPolymorphic); }
319  bool IsRelationshipPolymorphic() const { return GetFlag (kFlag_RelationshipPolymorphic); }
322 
324  void SetRelationshipClass (ECN::SchemaNameClassNamePairCR pair) { m_relationshipName = pair; }
326  void SetRelatedClass (ECN::SchemaNameClassNamePairCR pair) { m_relatedClassName = pair; }
328  DGNPLATFORM_EXPORT void SetNestedSpecification (DgnECHostRelationshipSpecificationCP spec);
329 
331  void SetRequired (bool required) { SetFlag (kFlag_Required, required); }
333  void SetRelationshipPolymorphic (bool poly) { SetFlag (kFlag_RelationshipPolymorphic, poly); }
335  void SetRelatedPolymorphic (bool poly) { SetFlag (kFlag_RelatedPolymorphic, poly); }
337  void SetDirection (ECN::ECRelatedInstanceDirection dir) { SetFlag (kFlag_Backward, dir == ECN::STRENGTHDIRECTION_Backward); }
338 
339  };
340 
341 typedef bvector<DgnECHostRelationshipSpecification> DgnECHostRelationshipSpecificationList;
344 
345 /*---------------------------------------------------------------------------------**/
352  {
353 private:
354  SchemaClassNameList m_primaryClasses;
356 public:
358  SchemaClassNameListCR GetPrimaryClasses() const { return m_primaryClasses; }
360  SchemaClassNameListR GetPrimaryClasses() { return m_primaryClasses; }
362  DgnECHostRelationshipSpecificationListCR GetRelationships() const { return m_relationships; }
365 
367  void SetPrimaryClasses (SchemaClassNameListCR classes) { m_primaryClasses = classes; }
369  void SetRelationships (DgnECHostRelationshipSpecificationListCR rels){ m_relationships = rels; }
370 
371  };
372 
373 typedef bvector<DgnECHostSpecification> DgnECHostSpecificationList;
376 
377 /*---------------------------------------------------------------------------------**/
388  {
389 private:
390  DgnECHostSpecificationList m_hostSpecs;
391  DgnFileP m_currentDgnFile;
392 
393 public:
395  };
396 
397 /*---------------------------------------------------------------------------------**/
404  {
405 public:
406  /*---------------------------------------------------------------------------------**/
411  enum class Type
412  {
413  Model = 0,
414  File = 1,
415  Path = 2
416  };
417 
418  /*---------------------------------------------------------------------------------**/
424  {
425  All = 0,
426  None = 2
427  };
428 private:
429 
430  Type m_type;
431  ReferencedModelOption m_refOpt;
432  bool m_includeChildElements;
433  WString m_location;
434  WString m_qualifier;
435 public:
437  ReportScope() : m_type(Type::Model), m_refOpt(ReferencedModelOption::None), m_includeChildElements(false) { }
438 
440  DGNPLATFORM_EXPORT void InitForPath (WCharCP cfgVarExpression);
442  DGNPLATFORM_EXPORT void InitForFile (DgnDocumentMonikerCP moniker);
443 
445  DGNPLATFORM_EXPORT void InitForActiveModel(ReferencedModelOption refOpt = ReferencedModelOption::None);
447  DGNPLATFORM_EXPORT void InitForDefaultModel (DgnDocumentMonikerCP moniker, ReferencedModelOption refOpt = ReferencedModelOption::None);
449  DGNPLATFORM_EXPORT void InitForModel (WCharCP modelName, DgnDocumentMonikerCP moniker, ReferencedModelOption refOpt = ReferencedModelOption::None);
450 
452  Type GetType() const { return m_type; }
454  WCharCP GetLocation() const { return m_location.c_str(); }
456  WCharCP GetQualifier() const { return m_qualifier.c_str(); }
458  ReferencedModelOption GetReferencedModelOption() const { return m_refOpt; }
460  bool IncludesChildElements() const { return m_includeChildElements; }
461 
463  DgnDocumentMonikerPtr GetMoniker (DgnFileR fileContainingReportDefinition) const;
464 
466  void SetReferencedModelOption (ReferencedModelOption opt) { if (GetType() == Type::Model) m_refOpt = opt; }
468  void SetIncludeChildElements (bool include) { m_includeChildElements = include; }
469  };
470 
471 /*---------------------------------------------------------------------------------**/
479  {
480 private:
482 
484 
485 public:
487  DGNPLATFORM_EXPORT ReportScope::Type GetScopeType() const;
488 
490  DGNPLATFORM_EXPORT bool IsReferenced() const;
492  DGNPLATFORM_EXPORT ReportCategoryNodePtr GetCategory() const;
493 
495  DGNPLATFORM_EXPORT ReportDefinitionNodePtr Import (DgnFileR destinationFile, bool renameIfNecessary) const;
496 
498  DGNPLATFORM_EXPORT UInt32 GetColumnCount() const;
500  DGNPLATFORM_EXPORT ColumnGroupNodePtr GetColumnGroupNode (bool createIfNotFound);
502  DGNPLATFORM_EXPORT SortingGroupNodePtr GetSortingGroupNode (bool createIfNotFound);
504  DGNPLATFORM_EXPORT ColumnGroupNodeCP GetColumnGroupNode() const;
506  DGNPLATFORM_EXPORT SortingGroupNodeCP GetSortingGroupNode() const;
507 
509  DGNPLATFORM_EXPORT ColumnDefinitionNodePtr CreateColumnDefinition (WCharCP name, int sortPriority);
511  DGNPLATFORM_EXPORT SortingRuleNodePtr CreateSortingRule (WCharCP columnName, int sortPriority);
512 
514  DGNPLATFORM_EXPORT ColumnDefinitionNodeCP GetColumnByName (WCharCP name) const;
516  DGNPLATFORM_EXPORT ColumnDefinitionNodePtr GetColumnByName (WCharCP name);
517 
519  DGNPLATFORM_EXPORT bool GetHostSpecifications (DgnECHostSpecificationListR specs) const;
521  DGNPLATFORM_EXPORT bool SetHostSpecifications (DgnECHostSpecificationListCR specs);
522 
524  DGNPLATFORM_EXPORT ReportScope GetScope() const;
526  DGNPLATFORM_EXPORT bool SetScope (ReportScopeCR scope);
527 
529  DGNPLATFORM_EXPORT WString GetRowFilter() const;
531  DGNPLATFORM_EXPORT bool SetRowFilter (WCharCP expr);
532 
534  DGNPLATFORM_EXPORT static ReportDefinitionNodePtr FindById (ElementId id, DgnFileR dgnfile);
536  DGNPLATFORM_EXPORT static ReportDefinitionNodePtr FindByPath (WCharCP path, DgnFileR dgnfile);
537 
539  DGNPLATFORM_EXPORT static ReportDefinitionNodePtr From (ECReportNodeR node);
540  };
541 
542 /*---------------------------------------------------------------------------------**/
548  {
549 private:
551 public:
553  DGNPLATFORM_EXPORT static ReportCategoryNodePtr Create (WCharCP name, int sortPriority, DgnFileR dgnfile);
555  DGNPLATFORM_EXPORT static ReportCategoryNodePtr From (ECReportNodeR node);
557  DGNPLATFORM_EXPORT static ReportCategoryNodePtr FindByName (WCharCP name, DgnFileR dgnfile);
559  DGNPLATFORM_EXPORT ReportDefinitionNodePtr CreateReportDefinition (WCharCP name, int sortPriority);
560 
562  DGNPLATFORM_EXPORT ReportDefinitionNodePtr GenerateReportFromClass (ECN::ECClassCR ecClass, WCharCP name, int sortPriority = -1);
563  };
564 
565 /*---------------------------------------------------------------------------------**/
571  {
572 private:
573  ColumnGroupNode();
574 public:
576  DGNPLATFORM_EXPORT static ColumnGroupNodePtr From (ECReportNodeR node);
578  DGNPLATFORM_EXPORT ColumnDefinitionListCP GetColumnDefinitions() const;
580  DGNPLATFORM_EXPORT ColumnDefinitionNodePtr CreateColumnDefinition (WCharCP name, int sortPriority);
581  };
582 
583 /*---------------------------------------------------------------------------------**/
589  {
590 private:
592 public:
594  DGNPLATFORM_EXPORT static SortingGroupNodePtr From (ECReportNodeR node);
595 
597  DGNPLATFORM_EXPORT SortingRuleListCP GetSortingRules() const;
599  DGNPLATFORM_EXPORT SortingRuleNodeCP GetRuleForColumn (WCharCP columnName) const;
601  DGNPLATFORM_EXPORT SortingRuleNodePtr CreateSortingRule (WCharCP columnName, int priority);
602  };
603 
604 /*---------------------------------------------------------------------------------**/
610  {
611  };
612 
613 /*---------------------------------------------------------------------------------**/
619  {
620  struct const_iterator : std::iterator<std::forward_iterator_tag, DgnECHost>
621  {
622  friend struct DgnECHostIterable;
623  private:
625  DgnECHostPtr m_host;
626  DgnECHostIterable const& m_iterable;
627 
628  const_iterator (DgnECHostIterable const& iterable, bool isEnd)
629  : m_impl(isEnd ? iterable.m_primaryInstances.end() : iterable.m_primaryInstances.begin()), m_iterable(iterable)
630  {
631  CreateHost();
632  }
633 
634  DGNPLATFORM_EXPORT void CreateHost();
635  public:
638  : m_impl(other.m_impl), m_host(other.m_host), m_iterable(other.m_iterable) { }
639 
641  DgnECHostR operator*() const { BeAssert (m_host.IsValid()); return *m_host; }
643  DgnECHostP operator->() const { return &(**this); }
645  bool operator== (const_iterator const& rhs) const { return &m_iterable == &rhs.m_iterable && m_impl == rhs.m_impl; }
647  bool operator!= (const_iterator const& rhs) const { return !(*this == rhs); }
649  const_iterator& operator++() { ++m_impl; CreateHost(); return *this; }
650  };
651 
653 private:
654  friend struct const_iterator;
655 
656  DgnECInstanceIterable m_primaryInstances;
657  mutable DgnECHostSpecificationsContext m_context;
658 public:
660  DgnECHostIterable (DgnECInstanceIterable primaryInstances, DgnECHostSpecificationsContextCR context)
661  : m_primaryInstances(primaryInstances), m_context(context) { }
662 
664  const_iterator begin() const { return const_iterator (*this, false); }
666  const_iterator end() const { return const_iterator (*this, true); }
668  bool empty() const { return m_primaryInstances.empty(); }
669  };
670 
671 /*---------------------------------------------------------------------------------**/
677  {
678  };
679 
680 /*---------------------------------------------------------------------------------**/
685  {
686  DGNPLATFORM_EXPORT static HostExpressionCriterionPtr Create (WCharCP expressionString, WCharCP hostSymbolName, DgnECHostSpecificationsContextCR hostSpecContext);
687  };
688 
689 /*---------------------------------------------------------------------------------**/
694  {
695 private:
696  WString m_content;
697  WString m_instanceId;
698  ECN::ECValue m_value;
699  ReportColumnAccessorCP m_accessor;
700  WString m_sourceFileName;
701 public:
704  // Returns the string value of this entry
705  WStringCR GetContent() const { return m_content; }
706  // Returns the ID of the IECInstance from which this entry's value was obtained
707  WStringCR GetSourceInstanceId() const { return m_instanceId; }
708  // Returns the ReportColumnAccessor by which this entry's value was obtained from the IECInstance
709  ReportColumnAccessorCP GetSourceAccessor() const { return m_accessor; }
710  // Returns the value of the underlying type. Useful for e.g. sorting or comparing numeric or date properties.
711  // If the underlying property has units they will have been applied.
712  ECN::ECValueCR GetValue() const { return m_value; }
713  // Returns the name of the DgnFile from which this entry's IECInstance originated
714  WStringCR GetSourceFileName() const { return m_sourceFileName; }
715  };
716 
717 /*---------------------------------------------------------------------------------**/
721 struct ReportResultsRow : bvector<ReportResultsEntry> { };
722 
723 /*---------------------------------------------------------------------------------**/
727 struct ReportResultsIterator : RefCountedBase, std::iterator<std::forward_iterator_tag, ReportResultsRow const>
728  {
729 public:
730  typedef ReportResultsRowCR reference;
731 
732  virtual bool IsDifferent (ReportResultsIterator const& rhs) const = 0;
733  virtual void MoveToNext() = 0;
734  virtual reference GetCurrent() const = 0;
735  };
736 
737 /*---------------------------------------------------------------------------------**/
746  {
749 
750 private:
751  ReportDefinitionNodeCR m_reportDefinition;
752  DgnModelP m_defaultModel;
753  DgnECHostIterable m_hosts;
754  bvector<ReportColumnAccessorList> m_accessorsByColumnIndex;
755  bool m_allowHideRepeatedValues;
756 public:
758  DGNPLATFORM_EXPORT ReportResults(ReportDefinitionNodeCR reportDef, DgnModelP defaultModel);
759 
761  ReportDefinitionNodeCR GetReportDefinition() const { return m_reportDefinition; }
763  bool AllowHideRepeatedValues() const { return m_allowHideRepeatedValues; }
765  void SetAllowHideRepeatedValues (bool allow) { m_allowHideRepeatedValues = allow; }
766 
767  DGNPLATFORM_EXPORT const_iterator begin() const;
768  DGNPLATFORM_EXPORT const_iterator end() const;
769 
771  DGNPLATFORM_EXPORT bool WriteToCsv (BeTextFileR file) const;
772  };
773 
774 /*---------------------------------------------------------------------------------**/
779 struct ReportDefinitionCollectionIterator : std::iterator<std::forward_iterator_tag, ReportDefinitionNodeP const>
780  {
781 private:
783 
784  XDataNodeCollection m_categories;
785  XDataNodeCollection m_definitions;
787  XDataNodeCollection::const_iterator m_curDefinition;
788 
789  DGNPLATFORM_EXPORT ReportDefinitionCollectionIterator (XDataTreeOwnerP owner, bool isEnd);
790 public:
795 
799  DGNPLATFORM_EXPORT ReportDefinitionNodeP operator*() const;
801  ReportDefinitionNodeP operator->() const { return this->operator*(); }
805  bool operator!= (ReportDefinitionCollectionIterator const& other) const { return !(*this == other); }
806  };
807 
808 /*---------------------------------------------------------------------------------**/
814  {
815 private:
816  XDataTreeOwnerP m_owner;
817 public:
821  DGNPLATFORM_EXPORT ReportDefinitionCollection();
822 
825 
827  const_iterator begin() const { return ReportDefinitionCollectionIterator (m_owner, false); }
829  const_iterator end() const { return ReportDefinitionCollectionIterator (m_owner, true); }
830  };
831 
833 
ReportScope()
Default constructor: initializes to active model scope excluding reference attachments.
Definition: ECReportNode.h:437
ECN::QualifiedECAccessorR GetAccessor()
Returns the accessor for the root ECPropertyValue.
Definition: ECReportNode.h:201
Represents a single entry (cell) in a ReportResultsRow.
Definition: ECReportNode.h:693
ArrayAccessorList & GetArrayAccessors()
Returns the list of accessors for struct array members.
Definition: ECReportNode.h:207
void SetDirection(ECN::ECRelatedInstanceDirection dir)
Sets the direction in which the ECRelationship will be queried.
Definition: ECReportNode.h:337
Defines an ECPropertyValue from which to populate a column in a report.
Definition: ECReportNode.h:145
DgnECHostR operator*() const
Dereference operator.
Definition: ECReportNode.h:641
const_iterator end() const
Returns an iterator to the end of this collection.
Definition: ECReportNode.h:666
ReportDefinitionNodeP operator->() const
Dereference operator.
Definition: ECReportNode.h:801
const_iterator end() const
Returns an iterator to the end of this collection.
Definition: ECReportNode.h:829
bool IncludesChildElements() const
Returns whether public children of complex elements will be searched when populating report results...
Definition: ECReportNode.h:460
SchemaClassNameListCR GetPrimaryClasses() const
Returns the schema and class names of the primary ECInstances.
Definition: ECReportNode.h:358
DgnECHostRelationshipSpecification()
Default constructor.
Definition: ECReportNode.h:301
An ExpressionContext which can evaluate ECExpressions against a primary ECInstance plus a set of rela...
Definition: ECReportNode.h:676
const_iterator iterator
Definition: ECReportNode.h:652
void SetRequired(bool required)
Sets whether failure to find a related ECInstance matching this specification will exclude the source...
Definition: ECReportNode.h:331
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
ReportColumnAccessor()
Default constructor.
Definition: ECReportNode.h:192
bool IsRelationshipPolymorphic() const
Returns whether ECRelationships will be queried polymorphically.
Definition: ECReportNode.h:319
Holds all of the sorting rules defined for a report definition as child nodes.
Definition: ECReportNode.h:588
Evaluates an ECExpression against an InstanceExpressionContext representing a DgnECHost.
Definition: ECReportNode.h:684
WCharCP GetQualifier() const
Returns the "location qualifier" associated with this scope's location. Usually the name of a DgnMode...
Definition: ECReportNode.h:456
DgnECHostSpecificationList const & DgnECHostSpecificationListCR
Definition: ECReportNode.h:375
ECReportNodeType
The types of report nodes.
Definition: ECReportNode.h:55
Child of SortingGroupNode which defines sorting rules for a report.
Definition: ECReportNode.h:109
const_iterator begin() const
Returns an iterator to the beginning of this collection.
Definition: ECReportNode.h:827
SortingRuleList const * SortingRuleListCP
Definition: ECReportNode.h:255
Definition: TextTableHandler.h:216
const_iterator(const_iterator const &other)
Copy-constructor.
Definition: ECReportNode.h:637
IECInstance const * IECInstanceCP
Definition: ECObjects.h:67
const_iterator begin() const
Returns an iterator the the beginning of this collection.
Definition: ECReportNode.h:664
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
void SetRelationshipPolymorphic(bool poly)
Sets whether ECRelationships will be queried polymorphically.
Definition: ECReportNode.h:333
A context in which multiple IECInstances provide the context for expression evaluation.
Definition: ECExpressions.h:152
iterator begin()
Definition: stdcxx/bstdmap.h:178
bvector< DgnECHostSpecification > DgnECHostSpecificationList
Definition: ECReportNode.h:373
ReportDefinitionCollectionIterator const_iterator
Definition: ECReportNode.h:823
WCharCP GetAccessString() const
Returns the access string within the member.
Definition: ECReportNode.h:180
WStringCR GetSourceInstanceId() const
Definition: ECReportNode.h:707
bvector< SortingRuleNodePtr > SortingRuleList
Definition: ECReportNode.h:253
Defines a related ECInstance query to be included in the ECInstances queried by a ReportDefinition...
Definition: ECReportNode.h:267
ECN::QualifiedECAccessorCR GetAccessor() const
Returns the accessor for the root ECPropertyValue.
Definition: ECReportNode.h:199
bool IsRelatedPolymorphic() const
Returns whether related ECInstances will be queried polymorphically.
Definition: ECReportNode.h:317
ArrayAccessor(WCharCP memberAccessor, ReportColumnAccessor::ArrayOption memberArrayOption=ArrayOption::None)
Constructor.
Definition: ECReportNode.h:175
bvector< ArrayAccessor > ArrayAccessorList
Definition: ECReportNode.h:185
DgnECHostIterable(DgnECInstanceIterable primaryInstances, DgnECHostSpecificationsContextCR context)
Constructor.
Definition: ECReportNode.h:660
iterator end()
Definition: stdcxx/bstdmap.h:186
void SetPrimaryClasses(SchemaClassNameListCR classes)
Sets the schema and class names of the primary ECInstances from which the report results will be popu...
Definition: ECReportNode.h:367
void SetRelatedClass(ECN::SchemaNameClassNamePairCR pair)
Sets the schema and class name of the related ECInstance.
Definition: ECReportNode.h:326
Represents a "primary" DgnECInstance plus a collection of related ECInstances as a single unit...
Definition: ECReportNode.h:609
const_iterator iterator
Definition: ECReportNode.h:824
ArrayOption GetArrayOption() const
Returns the options for handling the root ECPropertyValue as an array property.
Definition: ECReportNode.h:203
uint8_t UInt8
Definition: Bentley.r.h:116
bool AllowHideRepeatedValues() const
Returns whether successive entries within a column with identical values should be left empty if spec...
Definition: ECReportNode.h:763
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
ECValue const & ECValueCR
Definition: ECObjects.h:46
bvector< ReportColumnAccessor > ReportColumnAccessorList
Definition: ECReportNode.h:211
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
void SetReferencedModelOption(ReferencedModelOption opt)
Sets how reference attachments will be searched for ReportScope::Type::Model.
Definition: ECReportNode.h:466
wchar_t const * WCharCP
Definition: Bentley.h:224
struct DgnPlatform::DgnDocumentMoniker const * DgnDocumentMonikerCP
Definition: DgnPlatform.h:197
DgnECHostRelationshipSpecificationList const & DgnECHostRelationshipSpecificationListCR
Definition: ECReportNode.h:343
ECReportNodeList const * ECReportNodeListCP
Definition: ECReportNode.h:67
uint32_t UInt32
Definition: Bentley.r.h:128
bstdmap & operator=(const bstdmap &__rhs)
Definition: stdcxx/bstdmap.h:170
DgnECHostRelationshipSpecificationList & DgnECHostRelationshipSpecificationListR
Definition: ECReportNode.h:342
const_iterator & operator++()
pre-increment operator
Definition: ECReportNode.h:649
VirtualCollectionIterator< ReportResultsIterator > const_iterator
Definition: ECReportNode.h:747
Parent: Category. Children: ColumnGroup, SortingGroup.
DgnECHostP operator->() const
Dereference operator.
Definition: ECReportNode.h:643
bvector< ColumnDefinitionNodePtr > ColumnDefinitionList
Definition: ECReportNode.h:254
ReportColumnAccessor::ArrayOption GetOption() const
Returns the option for handling array members, if this accessor identifies a nested array property...
Definition: ECReportNode.h:182
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
T_StdXDataNodeVector::const_iterator const_iterator
Definition: XDataNodeCollection.h:24
A ReportDefinitionNode defines a ReportScope and ECQuery, which together produce ECInstances to popul...
Definition: ECReportNode.h:478
Flags
Flags which control how related ECInstances are handled.
Definition: ECReportNode.h:274
Defines the scope in which a ReportDefinition will query for ECInstances from which to populate repor...
Definition: ECReportNode.h:403
! Class used to hold XAttribute data that contains the name, sort priority, and ! parent node informa...
Definition: XDataTreeNode.h:60
ReferencedModelOption GetReferencedModelOption() const
Returns the options for searching reference attachments for ReportScope::Type::Model.
Definition: ECReportNode.h:458
Related instance is the source in the relationship instance.
Definition: ECSchema.h:780
ECN::SchemaNameClassNamePairCR GetRelatedClass() const
Returns the schema and class name of the related ECClass.
Definition: ECReportNode.h:310
ColumnDefinitionList const * ColumnDefinitionListCP
Definition: ECReportNode.h:256
SchemaNameClassNamePair const & SchemaNameClassNamePairCR
Definition: ECObjects.h:101
#define DGNPLATFORM_REF_COUNTED_PTR(_sname_)
Definition: DgnPlatform.h:79
Iterates primary instances plus related instances on same host.
Definition: ECReportNode.h:618
#define DGNPLATFORM_TYPEDEFS(_name_)
Definition: DgnPlatform.h:73
Child of ColumnGroupNode which defines a column in the report.
Definition: ECReportNode.h:221
ReportResultsRowCR reference
Definition: ECReportNode.h:730
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
SchemaClassNameListR GetPrimaryClasses()
Returns the schema and class names of the primary ECInstances.
Definition: ECReportNode.h:360
Represents a single row in a ReportResults object.
Definition: ECReportNode.h:721
Defines the primary ECClasses plus related ECInstances which will be used to populate the results of ...
Definition: ECReportNode.h:351
Parent: SortingGroup. Children: None.
ReportColumnAccessorList const & ReportColumnAccessorListCR
Definition: ECReportNode.h:212
bvector< DgnECHostRelationshipSpecification > DgnECHostRelationshipSpecificationList
Definition: ECReportNode.h:341
SchemaClassNameList & SchemaClassNameListR
Definition: ECReportNode.h:259
ReferencedModelOption
Options for following reference attachments when searching with ReportScope::Type::Model.
Definition: ECReportNode.h:423
ArrayAccessor()
Default constructor.
Definition: ECReportNode.h:177
ReportColumnAccessor(WCharCP schemaName, WCharCP className, WCharCP accessString, ArrayOption arrayOption=ArrayOption::None)
Constructor.
Definition: ECReportNode.h:196
ECClass const & ECClassCR
Definition: ECObjects.h:63
DgnECHostRelationshipSpecificationListCR GetRelationships() const
Returns the list of specifications for ECInstances related to the primary ECInstances to also be incl...
Definition: ECReportNode.h:362
Parent: ReportDefinition. Children: SortingRule.
ECN::ECValueCR GetValue() const
Definition: ECReportNode.h:712
Provides iteration over a collection of report definitions.
Definition: ECReportNode.h:779
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
ECRelatedInstanceDirection
Used to describe the direction of a related instance within the context of an IECRelationshipInstance...
Definition: ECSchema.h:775
void SetRelationships(DgnECHostRelationshipSpecificationListCR rels)
Sets the specifications for ECInstances related to the primary ECInstances to also be included in the...
Definition: ECReportNode.h:369
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
This template is used by iterators that hide their implementation from the published API...
Definition: VirtualCollectionIterator.h:33
bvector< ECReportNodePtr > ECReportNodeList
Definition: ECReportNode.h:66
DVec3d operator*(Transform const &transform, DVec3d const &vector)
operator overload for multiplication of a transform and a vector li>The vector appears on the left as...
DgnECHostRelationshipSpecificationListR GetRelationships()
Returns the list of specifications for ECInstances related to the primary ECInstances to also be incl...
Definition: ECReportNode.h:364
bool operator!=(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:152
void SetRelationshipClass(ECN::SchemaNameClassNamePairCR pair)
Sets the schema and class name of the ECRelationshipClass.
Definition: ECReportNode.h:324
ECN::ECRelatedInstanceDirection GetDirection() const
Returns the direction in which the ECRelationship will be queried.
Definition: ECReportNode.h:321
Base class for all ECReport XDataTreeNodes.
Definition: ECReportNode.h:75
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
WStringCR GetSourceFileName() const
Definition: ECReportNode.h:714
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Every ReportDefinitionNode is defined within a category.
Definition: ECReportNode.h:547
Definition: WhereCriterion.h:335
Parent: None. Children: ReportDefinition.
Provides iteration over ReportResults.
Definition: ECReportNode.h:727
Type
The type of supported scopes.
Definition: ECReportNode.h:411
For struct arrays, identifies an ECPropertyValue within a struct array member.
Definition: ECReportNode.h:167
void SetIncludeChildElements(bool include)
Sets whether public children of complex elements will be searched when populating report results...
Definition: ECReportNode.h:468
unsigned short wchar_t
Definition: basetype.h:122
SchemaClassNameList const & SchemaClassNameListCR
Definition: ECReportNode.h:258
Type GetType() const
Returns the type of this ReportScope.
Definition: ECReportNode.h:452
const_iterator iterator
Definition: ECReportNode.h:748
ArrayAccessorList const & GetArrayAccessors() const
Returns the list of accessors for struct array members.
Definition: ECReportNode.h:205
QueryRelatedClassSpecifiers are specific to a DgnFile (they hold direct pointers to ECClasses)...
Definition: ECReportNode.h:387
Definition: XDataNodeCollection.h:21
bool IsRequired() const
Returns whether the source ECInstance will be excluded if this specification fails to find a related ...
Definition: ECReportNode.h:315
#define BeAssert(_Expression)
BeAssert performs the same function as the standard assert, plus it prevents the most common cases of...
Definition: BeAssert.h:56
Related instance is the target in the relationship instance.
Definition: ECSchema.h:778
! Used to return results from DgnECManager::FindInstances.
Definition: DgnECInstance.h:601
DgnECHostRelationshipSpecificationCP GetNestedSpecification() const
Returns the specifications for any ECInstances related to this related ECInstance which should be inc...
Definition: ECReportNode.h:312
WStringCR GetContent() const
Definition: ECReportNode.h:705
void SetAllowHideRepeatedValues(bool allow)
Sets whether successive entries within a column with identical values should be left empty if specifi...
Definition: ECReportNode.h:765
ReportDefinitionNodeCR GetReportDefinition() const
Returns the report definition from which these results were generated.
Definition: ECReportNode.h:761
void SetRelatedPolymorphic(bool poly)
Sets whether related ECInstances will be queried polymorphically.
Definition: ECReportNode.h:335
The result of executing a ReportDefinition.
Definition: ECReportNode.h:745
ECN::SchemaNameClassNamePairCR GetRelationshipClass() const
Returns the schema and class name of the ECRelationshipClass.
Definition: ECReportNode.h:308
ArrayOption
Options for how array properties should be handled.
Definition: ECReportNode.h:152
ReportColumnAccessorCP GetSourceAccessor() const
Definition: ECReportNode.h:709
ReportColumnAccessor::ArrayOption Option
Definition: ECReportNode.h:169
DgnECHostSpecificationList & DgnECHostSpecificationListR
Definition: ECReportNode.h:374
ReportColumnAccessor(ECN::QualifiedECAccessorCR accessor, ArrayOption arrayOption=ArrayOption::None)
Constructor.
Definition: ECReportNode.h:194
A collection of report definitions contained within a DgnFile.
Definition: ECReportNode.h:813
bvector< ECN::SchemaNameClassNamePair > SchemaClassNameList
Definition: ECReportNode.h:257
bool empty() const
Returns true if this collection is empty.
Definition: ECReportNode.h:668
WCharCP GetLocation() const
Returns the location associated with this scope.
Definition: ECReportNode.h:454
Parent: ReportDefinition. Children: ColumnDefinition.
Reads and Writes Text Files regardless of whether they are encoded on disk as locale-encoded ASCII...
Definition: BeTextFile.h:67
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Holds all of the column definitions belonging to a report definition as child nodes.
Definition: ECReportNode.h:570
bool operator==(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:146

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.