OpenShot Audio Library | OpenShotAudio 0.4.0
 
Loading...
Searching...
No Matches
juce_DynamicObject.h
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//==============================================================================
39class JUCE_API DynamicObject : public ReferenceCountedObject
40{
41public:
42 //==============================================================================
43 DynamicObject();
44 DynamicObject (const DynamicObject&);
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
127 JUCE_LEAK_DETECTOR (DynamicObject)
128};
129
130} // namespace juce
NamedValueSet & getProperties() noexcept
virtual bool hasProperty(const Identifier &propertyName) const
void setMethod(Identifier methodName, var::NativeFunction function)
virtual void removeProperty(const Identifier &propertyName)
virtual var invokeMethod(Identifier methodName, const var::NativeFunctionArgs &args)
const NamedValueSet & getProperties() const noexcept
virtual bool hasMethod(const Identifier &methodName) const
virtual const var & getProperty(const Identifier &propertyName) const
virtual void setProperty(const Identifier &propertyName, const var &newValue)