OpenShot Audio Library | OpenShotAudio: juce_DynamicObject.h Source File

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//==============================================================================
39 class JUCE_API DynamicObject : public ReferenceCountedObject
40{
41public:
42 //==============================================================================
43 DynamicObject();
44 DynamicObject (const DynamicObject&);
45 ~DynamicObject() override;
46
47 using Ptr = ReferenceCountedObjectPtr<DynamicObject>;
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
juce::DynamicObject
Definition juce_DynamicObject.h:40
juce::DynamicObject::getProperties
NamedValueSet & getProperties() noexcept
Definition juce_DynamicObject.h:99
juce::DynamicObject::getProperties
const NamedValueSet & getProperties() const noexcept
Definition juce_DynamicObject.h:102
juce::Identifier
Definition juce_Identifier.h:39
juce::JSON::FormatOptions
Definition juce_JSON.h:102
juce::NamedValueSet
Definition juce_NamedValueSet.h:35
juce::OutputStream
Definition juce_OutputStream.h:38
juce::ReferenceCountedObjectPtr< DynamicObject >
juce::ReferenceCountedObject
Definition juce_ReferenceCountedObject.h:66
juce::var
Definition juce_Variant.h:42
juce::var::NativeFunctionArgs
Definition juce_Variant.h:49