2017-08-05 13:09:50 +00:00
|
|
|
#include <nx/HandleTableSizeHandler.h>
|
2017-07-12 14:02:10 +00:00
|
|
|
|
|
|
|
nx::HandleTableSizeHandler::HandleTableSizeHandler() :
|
|
|
|
mIsSet(false),
|
|
|
|
mEntry(0)
|
|
|
|
{}
|
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
void nx::HandleTableSizeHandler::operator=(const HandleTableSizeHandler & other)
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
2018-06-24 15:01:16 +00:00
|
|
|
mIsSet = other.mIsSet;
|
|
|
|
mEntry.setKernelCapability(other.mEntry.getKernelCapability());
|
2017-07-12 14:02:10 +00:00
|
|
|
}
|
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
bool nx::HandleTableSizeHandler::operator==(const HandleTableSizeHandler & other) const
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
2018-06-24 15:01:16 +00:00
|
|
|
return (mIsSet == other.mIsSet) \
|
|
|
|
&& (mEntry.getKernelCapability() == other.mEntry.getKernelCapability());
|
2017-07-12 14:02:10 +00:00
|
|
|
}
|
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
bool nx::HandleTableSizeHandler::operator!=(const HandleTableSizeHandler & other) const
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
2018-06-24 15:01:16 +00:00
|
|
|
return !(*this == other);
|
2017-07-12 14:02:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void nx::HandleTableSizeHandler::importKernelCapabilityList(const fnd::List<KernelCapability>& caps)
|
|
|
|
{
|
2018-06-24 15:01:16 +00:00
|
|
|
if (caps.size() > kMaxKernelCapNum)
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
|
|
|
throw fnd::Exception(kModuleName, "Too many kernel capabilities");
|
|
|
|
}
|
|
|
|
|
2018-06-24 15:01:16 +00:00
|
|
|
if (caps.size() == 0)
|
2017-07-12 14:02:10 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
mEntry.setKernelCapability(caps[0]);
|
|
|
|
mIsSet = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void nx::HandleTableSizeHandler::exportKernelCapabilityList(fnd::List<KernelCapability>& caps) const
|
|
|
|
{
|
|
|
|
if (isSet() == false)
|
|
|
|
return;
|
|
|
|
|
|
|
|
caps.addElement(mEntry.getKernelCapability());
|
|
|
|
}
|
|
|
|
|
|
|
|
void nx::HandleTableSizeHandler::clear()
|
|
|
|
{
|
|
|
|
mIsSet = false;
|
|
|
|
mEntry.setHandleTableSize(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool nx::HandleTableSizeHandler::isSet() const
|
|
|
|
{
|
|
|
|
return mIsSet;
|
|
|
|
}
|
|
|
|
|
2018-03-22 05:26:22 +00:00
|
|
|
uint16_t nx::HandleTableSizeHandler::getHandleTableSize() const
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
|
|
|
return mEntry.getHandleTableSize();
|
|
|
|
}
|
|
|
|
|
2018-03-22 05:26:22 +00:00
|
|
|
void nx::HandleTableSizeHandler::setHandleTableSize(uint16_t size)
|
2017-07-12 14:02:10 +00:00
|
|
|
{
|
|
|
|
mEntry.setHandleTableSize(size);
|
|
|
|
mIsSet = true;
|
2018-06-24 15:01:16 +00:00
|
|
|
}
|