kodi
BufferObjectFactory.h
1 /*
2  * Copyright (C) 2005-2020 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "BufferObject.h"
12 
13 #include <functional>
14 #include <list>
15 #include <memory>
16 
22 {
23 public:
32  static std::unique_ptr<CBufferObject> CreateBufferObject(bool needsCreateBySize);
33 
38  static void RegisterBufferObject(const std::function<std::unique_ptr<CBufferObject>()>&);
39 
44  static void ClearBufferObjects();
45 
46 protected:
47  static std::list<std::function<std::unique_ptr<CBufferObject>()>> m_bufferObjects;
48 };
static void RegisterBufferObject(const std::function< std::unique_ptr< CBufferObject >()> &)
Registers a CBufferObject class to class to the factory.
Definition: BufferObjectFactory.cpp:33
Factory that provides CBufferObject registration and creation.
Definition: BufferObjectFactory.h:21
static std::unique_ptr< CBufferObject > CreateBufferObject(bool needsCreateBySize)
Create a CBufferObject from the registered BufferObject types.
Definition: BufferObjectFactory.cpp:13
static void ClearBufferObjects()
Clears the list of registered CBufferObject types.
Definition: BufferObjectFactory.cpp:39