Ocean
ConfigMedium.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_MEDIA_CONFIG_MEDIUM_H
9 #define META_OCEAN_MEDIA_CONFIG_MEDIUM_H
10 
11 #include "ocean/media/Media.h"
12 #include "ocean/media/Medium.h"
13 #include "ocean/media/MediumRef.h"
14 
15 #include <vector>
16 
17 namespace Ocean
18 {
19 
20 namespace Media
21 {
22 
23 // Forward declaration.
24 class ConfigMedium;
25 
26 /**
27  * Definition of a smart medium reference holding a config medium object.
28  * @see SmartMediumRef, ConfigMedium.
29  * @ingroup media
30  */
32 
33 /**
34  * This class is the base class for all mediums with advanced configuration possibilities.
35  * @ingroup media
36  */
37 class OCEAN_MEDIA_EXPORT ConfigMedium : virtual public Medium
38 {
39  public:
40 
41  /**
42  * Definition of a vector holding configuration names.
43  */
44  typedef std::vector<std::string> ConfigNames;
45 
46  public:
47 
48  /**
49  * Starts a configuration possibility.
50  * @param name The name of the configuration to start
51  * @param data Possible configuration data like gui handles.
52  * @return True, if succeeded
53  */
54  virtual bool configuration(const std::string& name, long long data);
55 
56  /**
57  * Returns the names of the configuration possibilities.
58  * @return Names of configurations
59  */
60  virtual ConfigNames configs() const;
61 
62  protected:
63 
64  /**
65  * Creates a new ConfigMedium object by a given url.
66  * @param url Url of medium
67  */
68  explicit ConfigMedium(const std::string& url);
69 };
70 
71 }
72 
73 }
74 
75 #endif // META_OCEAN_MEDIA_CONFIG_MEDIUM_H
This class is the base class for all mediums with advanced configuration possibilities.
Definition: ConfigMedium.h:38
ConfigMedium(const std::string &url)
Creates a new ConfigMedium object by a given url.
std::vector< std::string > ConfigNames
Definition of a vector holding configuration names.
Definition: ConfigMedium.h:44
virtual bool configuration(const std::string &name, long long data)
Starts a configuration possibility.
virtual ConfigNames configs() const
Returns the names of the configuration possibilities.
This is the base class for all mediums.
Definition: Medium.h:48
This class implements a smart medium reference.
Definition: MediumRef.h:33
SmartMediumRef< ConfigMedium > ConfigMediumRef
Definition of a smart medium reference holding a config medium object.
Definition: ConfigMedium.h:24
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15