SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
StringItem.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 // .NAME StringItem.h -
11 // .SECTION Description
12 // .SECTION See Also
13 
14 #ifndef smtk_attribute_StringItem_h
15 #define smtk_attribute_StringItem_h
16 
17 #include "smtk/CoreExports.h"
18 #include "smtk/attribute/ValueItemTemplate.h"
19 
20 namespace smtk
21 {
22 namespace attribute
23 {
24 class Attribute;
25 class StringItemDefinition;
26 class SMTKCORE_EXPORT StringItem : public ValueItemTemplate<std::string>
27 {
28  friend class StringItemDefinition;
29 
30 public:
32  ~StringItem() override;
33  Item::Type type() const override;
34 
35  // Returns true if the item's value is not to be displayed in a GUI
36  bool isSecure() const;
37 
38  using Item::assign;
39  // Assigns this item to be equivalent to another. Options are processed by derived item classes
40  // Returns true if success and false if a problem occurred. By default, an attribute being used by this
41  // to represent an expression will be copied if needed. Use IGNORE_EXPRESSIONS option to prevent this
42  // When an expression attribute is copied, its associations are by default not.
43  // Use COPY_NEW_ASSOCIATIONS if you want them copied as well.These options are defined in CopyAssigmentOptions.h .
44  bool assign(
45  const smtk::attribute::ConstItemPtr& sourceItem,
46  const CopyAssignmentOptions& options,
47  smtk::io::Logger& logger) override;
48 
49 protected:
50  StringItem(Attribute* owningAttribute, int itemPosition);
51  StringItem(Item* owningItem, int myPosition, int mySubGroupPosition);
52 
53 private:
54 };
55 } // namespace attribute
56 } // namespace smtk
57 
58 #endif /* smtk_attribute_StringItem_h */
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::Item::Type
Type
Definition: Item.h:52
smtk::attribute::StringItemDefinition
Definition: StringItemDefinition.h:23
smtk::attribute::CopyAssignmentOptions
Class used to specify copy and assignment options.
Definition: CopyAssignmentOptions.h:211
smtk::attribute::StringItem
Definition: StringItem.h:26
smtk::attribute::ValueItemTemplate
Definition: ValueItemTemplate.h:33
smtk::attribute::Item::assign
virtual bool assign(const smtk::attribute::ConstItemPtr &sourceItem, unsigned int options)
Assigns this item to be equivalent to another.
Definition: Item.cxx:292
smtk::io::Logger
Log messages for later presentation to a user or a file.
Definition: Logger.h:95
smtk::attribute::Item
Definition: Item.h:43
smtkTypeMacro
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:51
smtk::attribute::ConstItemPtr
smtk::shared_ptr< const smtk::attribute::Item > ConstItemPtr
Definition: PublicPointerDefs.h:469
smtk::attribute::Attribute
Represent a (possibly composite) value according to a definition.
Definition: Attribute.h:49