JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_DynamicObject.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
40{
41public:
42 //==============================================================================
45 ~DynamicObject() override;
46
48
49 //==============================================================================
53 virtual bool hasProperty (const Identifier& propertyName) const;
54
58 virtual const var& getProperty (const Identifier& propertyName) const;
59
61 virtual void setProperty (const Identifier& propertyName, const var& newValue);
62
64 virtual void removeProperty (const Identifier& propertyName);
65
66 //==============================================================================
73 virtual bool hasMethod (const Identifier& methodName) const;
74
83 virtual var invokeMethod (Identifier methodName,
84 const var::NativeFunctionArgs& args);
85
92 void setMethod (Identifier methodName, var::NativeFunction function);
93
94 //==============================================================================
96 void clear();
97
99 NamedValueSet& getProperties() noexcept { return properties; }
100
102 const NamedValueSet& getProperties() const noexcept { return properties; }
103
105 void cloneAllProperties();
106
107 //==============================================================================
113 virtual std::unique_ptr<DynamicObject> clone() const;
114
115 //==============================================================================
121 virtual void writeAsJSON (OutputStream&, const JSON::FormatOptions&);
122
123private:
124 //==============================================================================
125 NamedValueSet properties;
126
128};
129
130} // namespace juce
Represents a dynamically implemented object.
NamedValueSet & getProperties() noexcept
Returns the NamedValueSet that holds the object's properties.
const NamedValueSet & getProperties() const noexcept
Returns the NamedValueSet that holds the object's properties.
Represents a string identifier, designed for accessing properties by name.
Allows formatting var objects as JSON with various configurable options.
Definition juce_JSON.h:102
Holds a set of named var objects.
The base class for streams that write data to some kind of destination.
A base class which provides methods for reference-counting.
A variant class, that can be used to hold a range of primitive values.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
JUCE Namespace.
This structure is passed to a NativeFunction callback, and contains invocation details about the func...