-#ifndef __DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H__
-#define __DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H__
+#ifndef DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H
+#define DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/update/common/scene-graph-buffers.h>
+// EXTERNAL INCLUDES
+#include <cstddef>
+
namespace Dali
{
-
namespace Integration
{
class RenderController;
class SceneGraphBuffers;
}
-
namespace Update
{
-
/**
* Used by UpdateManager to receive messages from the event-thread.
*/
class MessageQueue
{
public:
-
/**
* Create a new UpdateMessageQueue.
* @param[in] renderController After messages are flushed, we request a render from the RenderController.
* @param[in] sceneGraphBuffers Used to keep track of which buffers are being written or read.
*/
- MessageQueue( Integration::RenderController& renderController,
- const SceneGraph::SceneGraphBuffers& sceneGraphBuffers );
+ MessageQueue(Integration::RenderController& renderController,
+ const SceneGraph::SceneGraphBuffers& sceneGraphBuffers);
/**
* Destructor
* @param[in] updateScene If set to true, denotes that the message will cause the scene graph node tree to require an update
* @return A pointer to the first char allocated for the message
*/
- uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene );
+ uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene);
/**
* Flushes the message queue
* @param updateBufferIndex to use
* @return true if the scene graph node tree is updated
*/
- bool ProcessMessages( BufferIndex updateBufferIndex );
+ bool ProcessMessages(BufferIndex updateBufferIndex);
/**
* Query whether the queue was empty this frame.
*/
bool IsSceneUpdateRequired() const;
-private:
+ /**
+ * Query for the capacity of the current message queue
+ */
+ std::size_t GetCapacity() const;
+private:
/**
* Helper to call Process and destructor on each queued message
* @param[in] minorQueue The queue to process.
*/
- void ProcessMinorQueue( char* minorQueue );
+ void ProcessMinorQueue(char* minorQueue);
private:
-
// Not copyable:
- MessageQueue() = delete;
- MessageQueue ( const MessageQueue& rhs ) = delete;
- MessageQueue& operator=( const MessageQueue& rhs ) = delete;
+ MessageQueue() = delete;
+ MessageQueue(const MessageQueue& rhs) = delete;
+ MessageQueue& operator=(const MessageQueue& rhs) = delete;
private:
-
struct Impl;
Impl* mImpl;
};
} // namespace Dali
-#endif // __DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H__
+#endif // DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H