Files
surfer/openssl-act-engine/src/SlotList.h
Marc Wäckerlin 8069fba3ee closes #11
2011-01-14 08:47:20 +00:00

65 lines
1005 B
C++

#ifndef __SLOTLIST_H__
#define __SLOTLIST_H__
#include <vector>
namespace act
{
class ISlot;
class IToken;
}
class SlotEntry
{
public:
SlotEntry();
SlotEntry(const SlotEntry& old_entry);
void init(act::ISlot* slot_blueprint);
~SlotEntry();
void invalidate_token();
void preload_token();
inline act::ISlot* getSlot() const { return m_slot; }
act::IToken* getToken();
private:
void cleanup();
act::ISlot* m_slot;
act::IToken* m_token;
};
/*!
* Holds a list of the present slots in the system
* TODO: Slot addition/removal detection
*/
class SlotList
{
public:
typedef std::vector<SlotEntry> slot_list_t;
SlotList();
SlotList(size_t expected_size);
~SlotList();
void reserve(size_t expected_size);
void addSlot(act::ISlot* slot);
void removeSlot(act::ISlot* slot);
void clear();
act::ISlot* getSlot(size_t index);
act::IToken* getToken(size_t index);
inline size_t getNumSlots() { return m_slot_list.size(); }
private:
slot_list_t m_slot_list;
};
#endif