1 #ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
24 #include <dali/integration-api/resource-declarations.h>
25 #include <dali/internal/common/buffer-index.h>
34 class PropertyBufferDataProvider
39 * Type for the data contained in the buffer
41 typedef Dali::Vector< char > BufferType;
47 PropertyBufferDataProvider()
52 * Check if the data has changed
53 * @param[in] bufferIndex Index to access double buffered values
54 * @return true if the data has changed
56 virtual bool HasDataChanged( BufferIndex bufferIndex ) const = 0;
59 * Get the number of attributes
60 * @param[in] bufferIndex Index to access double buffered values
61 * @return the number of attributes
63 virtual unsigned int GetAttributeCount( BufferIndex bufferIndex ) const = 0;
66 * Get the name of an attribute
67 * @param[in] bufferIndex Index to access double buffered values
68 * @param[in] index Index of the attribute
69 * @return the name of the attribute
71 virtual const std::string& GetAttributeName( BufferIndex bufferIndex, unsigned int index ) const = 0;
74 * Get the byte size of an attribute
75 * @param[in] bufferIndex Index to access double buffered values
76 * @param[in] index Index of the attribute
77 * @return the byte size of the attribute
79 virtual size_t GetAttributeSize( BufferIndex bufferIndex, unsigned int index ) const = 0;
82 * Get the byte offset of an attribute
83 * @param[in] bufferIndex Index to access double buffered values
84 * @param[in] index Index of the attribute
85 * @return the byte offset of the attribute
87 virtual size_t GetAttributeOffset( BufferIndex bufferIndex, unsigned int index ) const = 0;
90 * Get the property buffer data
91 * @param[in] bufferIndex Index to access double buffered values
92 * @return the property buffer's data array
94 virtual const BufferType& GetData( BufferIndex bufferIndex ) const = 0;
97 * Get the size of the property buffer in bytes
98 * @param[in] bufferIndex Index to access double buffered values
99 * @return the size in bytes
101 virtual size_t GetDataSize( BufferIndex bufferIndex ) const = 0;
104 * Get the size of an element of the buffer in bytes
105 * @param[in] bufferIndex Index to access double buffered values
106 * @return the element size in bytes
108 virtual size_t GetElementSize( BufferIndex bufferIndex ) const = 0;
111 * Get the number of elements
112 * @param[in] bufferIndex Index to access double buffered values
113 * @return the number of elements
115 virtual unsigned int GetElementCount( BufferIndex bufferIndex ) const = 0;
118 * Get Id of the GPU buffer associated with this propertyBuffer
119 * @param[in] bufferIndex Index to access double buffered values
122 virtual unsigned int GetGpuBufferId( BufferIndex bufferIndex ) const = 0;
126 * No deletion through this interface
128 virtual ~PropertyBufferDataProvider()
133 } // namespace SceneGraph
134 } // namespace Internal
137 #endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H