Add stringifiers to SenseApi related classes
This commit is contained in:
@@ -51,6 +51,15 @@ public:
|
|||||||
std::string name;
|
std::string name;
|
||||||
// These are the implexors whose APIs this lib exports.
|
// These are the implexors whose APIs this lib exports.
|
||||||
std::vector<ExportedImplexorApiDesc> exportedImplexorApis;
|
std::vector<ExportedImplexorApiDesc> exportedImplexorApis;
|
||||||
|
|
||||||
|
std::string stringify() const {
|
||||||
|
std::string result = "Name: " + name + "\n";
|
||||||
|
result += "Exported Implexor APIs:\n";
|
||||||
|
for (const auto& api : exportedImplexorApis) {
|
||||||
|
result += " - " + api.name + "\n";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class SenseApiLib
|
class SenseApiLib
|
||||||
@@ -111,6 +120,12 @@ public:
|
|||||||
* descriptor.
|
* descriptor.
|
||||||
*/
|
*/
|
||||||
SenseApiDesc senseApiDesc;
|
SenseApiDesc senseApiDesc;
|
||||||
|
|
||||||
|
std::string stringify() const {
|
||||||
|
std::string result = "Library Path: " + libraryPath + "\n";
|
||||||
|
result += "Sense API Descriptor: " + senseApiDesc.stringify() + "\n";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ public:
|
|||||||
void unloadSenseApiLib(const std::string& libraryPath);
|
void unloadSenseApiLib(const std::string& libraryPath);
|
||||||
void loadAllSenseApiLibsFromOptions(void);
|
void loadAllSenseApiLibsFromOptions(void);
|
||||||
|
|
||||||
|
std::string stringifyLibs() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SenseApiManager() = default;
|
SenseApiManager() = default;
|
||||||
~SenseApiManager() = default;
|
~SenseApiManager() = default;
|
||||||
|
|||||||
@@ -151,5 +151,14 @@ void SenseApiManager::loadAllSenseApiLibsFromOptions()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string SenseApiManager::stringifyLibs() const
|
||||||
|
{
|
||||||
|
std::string result;
|
||||||
|
for (const auto& lib : senseApiLibs) {
|
||||||
|
result += lib->stringify() + "\n";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
} // namespace hk
|
} // namespace hk
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ static int initializeHarikoff(int argc, char **argv, char **envp)
|
|||||||
DeviceManager::getInstance().parseAllDeviceSpecs();
|
DeviceManager::getInstance().parseAllDeviceSpecs();
|
||||||
std::cout << DeviceManager::stringifyDeviceSpecs() << std::endl;
|
std::cout << DeviceManager::stringifyDeviceSpecs() << std::endl;
|
||||||
sense_api::SenseApiManager::getInstance().loadAllSenseApiLibsFromOptions();
|
sense_api::SenseApiManager::getInstance().loadAllSenseApiLibsFromOptions();
|
||||||
|
std::cout << sense_api::SenseApiManager::getInstance().stringifyLibs()
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
/* Start the threads */
|
/* Start the threads */
|
||||||
for (const auto& [id, componentThread]
|
for (const auto& [id, componentThread]
|
||||||
|
|||||||
Reference in New Issue
Block a user