Rename hk=>smo
This commit is contained in:
@@ -184,7 +184,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AttachedDevice(const hk::device::SenseDeviceSpec &spec,
|
AttachedDevice(const smo::device::SenseDeviceSpec &spec,
|
||||||
std::shared_ptr<XcbConnection> conn)
|
std::shared_ptr<XcbConnection> conn)
|
||||||
: deviceSpec(spec)
|
: deviceSpec(spec)
|
||||||
// This std::move is moving ownership from a shared_ptr to a shared_ptr
|
// This std::move is moving ownership from a shared_ptr to a shared_ptr
|
||||||
@@ -229,14 +229,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hk::device::SenseDeviceSpec deviceSpec;
|
smo::device::SenseDeviceSpec deviceSpec;
|
||||||
WindowSelector windowSelector;
|
WindowSelector windowSelector;
|
||||||
std::shared_ptr<XcbConnection> connection;
|
std::shared_ptr<XcbConnection> connection;
|
||||||
std::string actualWindowName;
|
std::string actualWindowName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int getRequiredParamAsInt(
|
static int getRequiredParamAsInt(
|
||||||
const hk::device::SenseDeviceSpec& spec,
|
const smo::device::SenseDeviceSpec& spec,
|
||||||
const std::string& paramName)
|
const std::string& paramName)
|
||||||
{
|
{
|
||||||
auto it = std::find_if(
|
auto it = std::find_if(
|
||||||
@@ -263,7 +263,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void parseWindowSelector(
|
static void parseWindowSelector(
|
||||||
const hk::device::SenseDeviceSpec& spec,
|
const smo::device::SenseDeviceSpec& spec,
|
||||||
WindowSelector& windowSelector)
|
WindowSelector& windowSelector)
|
||||||
{
|
{
|
||||||
// Default match type
|
// Default match type
|
||||||
@@ -428,12 +428,12 @@ static xcb_window_t findByName(
|
|||||||
|
|
||||||
} // namespace xcb_window_search
|
} // namespace xcb_window_search
|
||||||
|
|
||||||
static hk::sense_api::sal_mlo_initializeIndFn xcbXorg_initializeInd;
|
static smo::sense_api::sal_mlo_initializeIndFn xcbXorg_initializeInd;
|
||||||
static hk::sense_api::sal_mlo_finalizeIndFn xcbXorg_finalizeInd;
|
static smo::sense_api::sal_mlo_finalizeIndFn xcbXorg_finalizeInd;
|
||||||
static hk::sense_api::sal_mlo_attachDeviceReqFn xcbXorg_attachDeviceReq;
|
static smo::sense_api::sal_mlo_attachDeviceReqFn xcbXorg_attachDeviceReq;
|
||||||
static hk::sense_api::sal_mlo_detachDeviceReqFn xcbXorg_detachDeviceReq;
|
static smo::sense_api::sal_mlo_detachDeviceReqFn xcbXorg_detachDeviceReq;
|
||||||
|
|
||||||
static hk::sense_api::SenseApiDesc xcbXorgApiDesc =
|
static smo::sense_api::SenseApiDesc xcbXorgApiDesc =
|
||||||
{
|
{
|
||||||
.name = "xcb",
|
.name = "xcb",
|
||||||
.exportedImplexorApis = { { "video-implexor" } },
|
.exportedImplexorApis = { { "video-implexor" } },
|
||||||
@@ -445,7 +445,7 @@ static hk::sense_api::SenseApiDesc xcbXorgApiDesc =
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Below here are the exported functions that Harikoff will use both to load
|
/* Below here are the exported functions that Salmanoff will use both to load
|
||||||
* and use this library.
|
* and use this library.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
@@ -459,10 +459,10 @@ static hk::sense_api::SenseApiDesc xcbXorgApiDesc =
|
|||||||
*
|
*
|
||||||
* @return A reference to the SenseApiDesc structure describing the API.
|
* @return A reference to the SenseApiDesc structure describing the API.
|
||||||
*/
|
*/
|
||||||
extern HK_UNMANGLED hk::sense_api::HK_GET_SENSE_API_DESC_FN_TYPEDEF
|
extern SMO_UNMANGLED smo::sense_api::SMO_GET_SENSE_API_DESC_FN_TYPEDEF
|
||||||
HK_GET_SENSE_API_DESC_FN_NAME;
|
SMO_GET_SENSE_API_DESC_FN_NAME;
|
||||||
|
|
||||||
const hk::sense_api::SenseApiDesc &HK_GET_SENSE_API_DESC_FN_NAME(void)
|
const smo::sense_api::SenseApiDesc &SMO_GET_SENSE_API_DESC_FN_NAME(void)
|
||||||
{
|
{
|
||||||
return xcbXorgApiDesc;
|
return xcbXorgApiDesc;
|
||||||
}
|
}
|
||||||
@@ -478,7 +478,7 @@ int xcbXorg_finalizeInd(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xcbXorg_attachDeviceReq(const hk::device::SenseDeviceSpec &desc)
|
int xcbXorg_attachDeviceReq(const smo::device::SenseDeviceSpec &desc)
|
||||||
{
|
{
|
||||||
// Ensure connection exists before creating device. Create conn'tion if not.
|
// Ensure connection exists before creating device. Create conn'tion if not.
|
||||||
XcbConnection::XConnectionIdentifier id{
|
XcbConnection::XConnectionIdentifier id{
|
||||||
@@ -505,7 +505,7 @@ int xcbXorg_attachDeviceReq(const hk::device::SenseDeviceSpec &desc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xcbXorg_detachDeviceReq(const hk::device::SenseDeviceSpec &spec)
|
int xcbXorg_detachDeviceReq(const smo::device::SenseDeviceSpec &spec)
|
||||||
{
|
{
|
||||||
auto it = std::find_if(attachedDevices.begin(), attachedDevices.end(),
|
auto it = std::find_if(attachedDevices.begin(), attachedDevices.end(),
|
||||||
[&spec](const AttachedDevice &device) {
|
[&spec](const AttachedDevice &device) {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#ifndef HK_PREPROCESSOR_H
|
#ifndef SMO_PREPROCESSOR_H
|
||||||
#define HK_PREPROCESSOR_H
|
#define SMO_PREPROCESSOR_H
|
||||||
|
|
||||||
#define HK_Q(x) #x
|
#define SMO_Q(x) #x
|
||||||
#define HK_QUOTE(x) HK_Q(x)
|
#define SMO_QUOTE(x) SMO_Q(x)
|
||||||
|
|
||||||
#define HK_CONCAT(a, b) a ## b
|
#define SMO_CONCAT(a, b) a ## b
|
||||||
|
|
||||||
#define HK_UNMANGLED "C"
|
#define SMO_UNMANGLED "C"
|
||||||
|
|
||||||
#endif // HK_PREPROCESSOR_H
|
#endif // SMO_PREPROCESSOR_H
|
||||||
|
|||||||
+17
-17
@@ -5,7 +5,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <user/senseDeviceSpec.h>
|
#include <user/senseDeviceSpec.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sense_api {
|
namespace sense_api {
|
||||||
|
|
||||||
typedef int (sal_mlo_initializeIndFn)(void);
|
typedef int (sal_mlo_initializeIndFn)(void);
|
||||||
@@ -15,15 +15,15 @@ typedef int (sal_mlo_detachDeviceReqFn)(const device::SenseDeviceSpec &desc);
|
|||||||
|
|
||||||
struct Sal_Mgmt_LibOps
|
struct Sal_Mgmt_LibOps
|
||||||
{
|
{
|
||||||
/* When Harikoff loads a sense API lib, it calls this function to initialize
|
/* When Salmanoff loads a sense API lib, it calls this function to initialize
|
||||||
* the lib. When this returns, the lib should be ready to attach devices.
|
* the lib. When this returns, the lib should be ready to attach devices.
|
||||||
*/
|
*/
|
||||||
sal_mlo_initializeIndFn *initializeInd;
|
sal_mlo_initializeIndFn *initializeInd;
|
||||||
/* Harikoff calls this to finalize the lib and free its internal
|
/* Salmanoff calls this to finalize the lib and free its internal
|
||||||
* resources. When this returns, the lib should be ready to be unloaded.
|
* resources. When this returns, the lib should be ready to be unloaded.
|
||||||
*/
|
*/
|
||||||
sal_mlo_finalizeIndFn *finalizeInd;
|
sal_mlo_finalizeIndFn *finalizeInd;
|
||||||
/* Harikoff calls this to attach a device to the lib. When it returns, the
|
/* Salmanoff calls this to attach a device to the lib. When it returns, the
|
||||||
* device should be attached and ready to be implexed.
|
* device should be attached and ready to be implexed.
|
||||||
*/
|
*/
|
||||||
sal_mlo_attachDeviceReqFn *attachDeviceReq;
|
sal_mlo_attachDeviceReqFn *attachDeviceReq;
|
||||||
@@ -42,7 +42,7 @@ struct Sal_Mgmt_LibOps
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Exported by all sense API Libraries to tell Harikoff what API the lib uses
|
/* Exported by all sense API Libraries to tell Salmanoff what API the lib uses
|
||||||
* to connect to providers; and also to state which implexor APIs it exports.
|
* to connect to providers; and also to state which implexor APIs it exports.
|
||||||
*/
|
*/
|
||||||
class SenseApiDesc
|
class SenseApiDesc
|
||||||
@@ -92,23 +92,23 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define HK_GET_SENSE_API_DESC_FN_NAME getSenseApiDesc
|
#define SMO_GET_SENSE_API_DESC_FN_NAME getSenseApiDesc
|
||||||
#define HK_GET_SENSE_API_DESC_FN_NAME_STR \
|
#define SMO_GET_SENSE_API_DESC_FN_NAME_STR \
|
||||||
HK_QUOTE(HK_GET_SENSE_API_DESC_FN_NAME)
|
SMO_QUOTE(SMO_GET_SENSE_API_DESC_FN_NAME)
|
||||||
#define HK_GET_SENSE_API_DESC_FN_TYPEDEF \
|
#define SMO_GET_SENSE_API_DESC_FN_TYPEDEF \
|
||||||
HK_CONCAT(HK_GET_SENSE_API_DESC_FN_NAME, Fn)
|
SMO_CONCAT(SMO_GET_SENSE_API_DESC_FN_NAME, Fn)
|
||||||
|
|
||||||
/* Every Sense API library must define a global instance of this
|
/* Every Sense API library must define a global instance of this
|
||||||
* function. Harikoff will search for it and invoke it via dlsym().
|
* function. Salmanoff will search for it and invoke it via dlsym().
|
||||||
*
|
*
|
||||||
* The function must return a SenseApiDesc struct that Hk will tell
|
* The function must return a SenseApiDesc struct that Smo will tell
|
||||||
* Hk what implexors can be used with it & what APIs it exports.
|
* Smo what implexors can be used with it & what APIs it exports.
|
||||||
* The SenseApiDesc struct also gives Hk pointers to API functions
|
* The SenseApiDesc struct also gives Smo pointers to API functions
|
||||||
* to invoke for communication between Hk and the library.
|
* to invoke for communication between Smo and the library.
|
||||||
*/
|
*/
|
||||||
typedef const SenseApiDesc &(HK_GET_SENSE_API_DESC_FN_TYPEDEF)(void);
|
typedef const SenseApiDesc &(SMO_GET_SENSE_API_DESC_FN_TYPEDEF)(void);
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // __USER_SENSE_API_LIB_H__
|
#endif // __USER_SENSE_API_LIB_H__
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace device {
|
namespace device {
|
||||||
|
|
||||||
class SenseDeviceSpec
|
class SenseDeviceSpec
|
||||||
@@ -72,6 +72,6 @@ class ExtrospectorDeviceSpec : public SenseDeviceSpec
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace device
|
} // namespace device
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // SENSORDEVICESPEC_H
|
#endif // SENSORDEVICESPEC_H
|
||||||
|
|||||||
@@ -11,11 +11,11 @@
|
|||||||
#include <senseApis/senseApiManager.h>
|
#include <senseApis/senseApiManager.h>
|
||||||
#include "componentThread.h"
|
#include "componentThread.h"
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
static int initializeHarikoff(int argc, char **argv, char **envp);
|
static int initializeSalmanoff(int argc, char **argv, char **envp);
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
@@ -25,12 +25,12 @@ int main(int argc, char **argv, char **envp)
|
|||||||
boost::asio::io_service::work work(mrntLoop);
|
boost::asio::io_service::work work(mrntLoop);
|
||||||
|
|
||||||
// Validate thread IDs
|
// Validate thread IDs
|
||||||
hk::ComponentThread::validateThreadIds();
|
smo::ComponentThread::validateThreadIds();
|
||||||
|
|
||||||
// Post initializeHarikoff to mrntLoop
|
// Post initializeSalmanoff to mrntLoop
|
||||||
mrntLoop.post([&]()
|
mrntLoop.post([&]()
|
||||||
{
|
{
|
||||||
int ret = hk::initializeHarikoff(argc, argv, envp);
|
int ret = smo::initializeSalmanoff(argc, argv, envp);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
std::cerr << "Initialization failed with code: "
|
std::cerr << "Initialization failed with code: "
|
||||||
@@ -57,15 +57,15 @@ int main(int argc, char **argv, char **envp)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
static int initializeHarikoff(int argc, char **argv, char **envp)
|
static int initializeSalmanoff(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
std::cout << __func__ << ": Entering" << std::endl;
|
std::cout << __func__ << ": Entering" << std::endl;
|
||||||
|
|
||||||
using namespace hk;
|
using namespace smo;
|
||||||
OptionParser &options = OptionParser::getOptions();
|
OptionParser &options = OptionParser::getOptions();
|
||||||
hk::Mind mind;
|
smo::Mind mind;
|
||||||
|
|
||||||
std::cout << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
|
std::cout << PACKAGE_NAME << " " << PACKAGE_VERSION << std::endl;
|
||||||
|
|
||||||
@@ -100,12 +100,12 @@ std::cerr << "Done attachAllSenseDevicesFromSpecs" << std::endl;
|
|||||||
|
|
||||||
/* Start the threads */
|
/* Start the threads */
|
||||||
for (const auto& [id, componentThread]
|
for (const auto& [id, componentThread]
|
||||||
: hk::ComponentThread::componentThreads) {
|
: smo::ComponentThread::componentThreads) {
|
||||||
hk::ComponentThread::signalThread(id);
|
smo::ComponentThread::signalThread(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << __func__ << ": Exiting" << std::endl;
|
std::cout << __func__ << ": Exiting" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <componentThread.h>
|
#include <componentThread.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
namespace director {
|
namespace director {
|
||||||
/* The director is the seat of volition in Harikoff. It receives sensor
|
/* The director is the seat of volition in Salmanoff. It receives sensor
|
||||||
* events from the body and world, and uses them to direct its implexors
|
* events from the body and world, and uses them to direct its implexors
|
||||||
* to implex new menties. It then loads the menties into canvas for simulation
|
* to implex new menties. It then loads the menties into canvas for simulation
|
||||||
* and correlation with intrins, in order to form new attrimotions and
|
* and correlation with intrins, in order to form new attrimotions and
|
||||||
@@ -13,14 +13,14 @@ namespace director {
|
|||||||
ComponentThread director;
|
ComponentThread director;
|
||||||
}
|
}
|
||||||
namespace simulator {
|
namespace simulator {
|
||||||
/* The canvas is the simulation engine in Harikoff. It receives menties and
|
/* The canvas is the simulation engine in Salmanoff. It receives menties and
|
||||||
* simulates them in accordance with the instructions from director. It then
|
* simulates them in accordance with the instructions from director. It then
|
||||||
* re-renders them into perception for director to get feedback.
|
* re-renders them into perception for director to get feedback.
|
||||||
*/
|
*/
|
||||||
ComponentThread canvas;
|
ComponentThread canvas;
|
||||||
}
|
}
|
||||||
namespace subconscious {
|
namespace subconscious {
|
||||||
/* The subconscious is the seat of memory in Harikoff. It receives menties
|
/* The subconscious is the seat of memory in Salmanoff. It receives menties
|
||||||
* from director and stores them in memory for later recall.
|
* from director and stores them in memory for later recall.
|
||||||
*/
|
*/
|
||||||
ComponentThread subconscious;
|
ComponentThread subconscious;
|
||||||
@@ -95,4 +95,4 @@ void ComponentThread::validateThreadIds(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <opts.h>
|
#include <opts.h>
|
||||||
#include <deviceManager/deviceManager.h>
|
#include <deviceManager/deviceManager.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace device {
|
namespace device {
|
||||||
|
|
||||||
std::vector<std::shared_ptr<InteroceptorDeviceSpec>>
|
std::vector<std::shared_ptr<InteroceptorDeviceSpec>>
|
||||||
@@ -34,4 +34,4 @@ const std::string DeviceManager::stringifyDeviceSpecs(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace device
|
} // namespace device
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "deviceSpecp.hh"
|
#include "deviceSpecp.hh"
|
||||||
#include "deviceSpecl.hh"
|
#include "deviceSpecl.hh"
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace device {
|
namespace device {
|
||||||
|
|
||||||
std::string DeviceManager::readDeviceFile(const std::string& filename)
|
std::string DeviceManager::readDeviceFile(const std::string& filename)
|
||||||
@@ -68,4 +68,4 @@ void DeviceManager::parseAllDeviceSpecs(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace device
|
} // namespace device
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ void yyerror(const char *message)
|
|||||||
%union {
|
%union {
|
||||||
char* str;
|
char* str;
|
||||||
char chr;
|
char chr;
|
||||||
hk::device::SenseDeviceSpec* sensorSpec;
|
smo::device::SenseDeviceSpec* sensorSpec;
|
||||||
hk::device::InteroceptorDeviceSpec* interoceptorSpec;
|
smo::device::InteroceptorDeviceSpec* interoceptorSpec;
|
||||||
hk::device::ExtrospectorDeviceSpec* extrospectorSpec;
|
smo::device::ExtrospectorDeviceSpec* extrospectorSpec;
|
||||||
std::vector<std::pair<std::string,std::string>>* paramVector;
|
std::vector<std::pair<std::string,std::string>>* paramVector;
|
||||||
std::pair<std::string,std::string>* param;
|
std::pair<std::string,std::string>* param;
|
||||||
}
|
}
|
||||||
@@ -83,12 +83,12 @@ sensor_spec:
|
|||||||
|
|
||||||
interoceptor_spec:
|
interoceptor_spec:
|
||||||
KEYWORD_SPECTYPE_INTEROSPECTOR PIPE spec_body {
|
KEYWORD_SPECTYPE_INTEROSPECTOR PIPE spec_body {
|
||||||
auto spec = std::make_shared<hk::device::InteroceptorDeviceSpec>(
|
auto spec = std::make_shared<smo::device::InteroceptorDeviceSpec>(
|
||||||
*static_cast<hk::device::InteroceptorDeviceSpec *>($3));
|
*static_cast<smo::device::InteroceptorDeviceSpec *>($3));
|
||||||
|
|
||||||
spec->sensorType = $1;
|
spec->sensorType = $1;
|
||||||
hk::device::DeviceManager::interoceptorDeviceSpecs.push_back(spec);
|
smo::device::DeviceManager::interoceptorDeviceSpecs.push_back(spec);
|
||||||
hk::device::DeviceManager::senseDeviceSpecs.push_back(spec);
|
smo::device::DeviceManager::senseDeviceSpecs.push_back(spec);
|
||||||
|
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
@@ -96,12 +96,12 @@ interoceptor_spec:
|
|||||||
|
|
||||||
extrospector_spec:
|
extrospector_spec:
|
||||||
KEYWORD_SPECTYPE_EXTROSPECTOR PIPE spec_body {
|
KEYWORD_SPECTYPE_EXTROSPECTOR PIPE spec_body {
|
||||||
auto spec = std::make_shared<hk::device::ExtrospectorDeviceSpec>(
|
auto spec = std::make_shared<smo::device::ExtrospectorDeviceSpec>(
|
||||||
*static_cast<hk::device::ExtrospectorDeviceSpec *>($3));
|
*static_cast<smo::device::ExtrospectorDeviceSpec *>($3));
|
||||||
|
|
||||||
spec->sensorType = $1;
|
spec->sensorType = $1;
|
||||||
hk::device::DeviceManager::extrospectorDeviceSpecs.push_back(spec);
|
smo::device::DeviceManager::extrospectorDeviceSpecs.push_back(spec);
|
||||||
hk::device::DeviceManager::senseDeviceSpecs.push_back(spec);
|
smo::device::DeviceManager::senseDeviceSpecs.push_back(spec);
|
||||||
|
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ extrospector_spec:
|
|||||||
|
|
||||||
spec_body:
|
spec_body:
|
||||||
STRING PIPE STRING LPAREN opt_params RPAREN PIPE STRING LPAREN opt_params RPAREN PIPE STRING {
|
STRING PIPE STRING LPAREN opt_params RPAREN PIPE STRING LPAREN opt_params RPAREN PIPE STRING {
|
||||||
$$ = new hk::device::SenseDeviceSpec();
|
$$ = new smo::device::SenseDeviceSpec();
|
||||||
$$->sensorType = '\0';
|
$$->sensorType = '\0';
|
||||||
$$->implexor = std::string($1);
|
$$->implexor = std::string($1);
|
||||||
$$->api = std::string($3);
|
$$->api = std::string($3);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
class ComponentThread
|
class ComponentThread
|
||||||
{
|
{
|
||||||
@@ -64,6 +64,6 @@ namespace subconscious {
|
|||||||
extern ComponentThread subconscious;
|
extern ComponentThread subconscious;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // COMPONENT_THREAD_H
|
#endif // COMPONENT_THREAD_H
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <user/senseDeviceSpec.h>
|
#include <user/senseDeviceSpec.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace device {
|
namespace device {
|
||||||
|
|
||||||
class DeviceManager
|
class DeviceManager
|
||||||
@@ -43,6 +43,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace device
|
} // namespace device
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // DEVICEMANAGER_H
|
#endif // DEVICEMANAGER_H
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <mentalEntity.h>
|
#include <mentalEntity.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace director {
|
namespace director {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,6 +74,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace director
|
} // namespace director
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // DIRECTOR_COMMANDLIST_H
|
#endif // DIRECTOR_COMMANDLIST_H
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <goal.h>
|
#include <goal.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace director {
|
namespace director {
|
||||||
|
|
||||||
class Director {
|
class Director {
|
||||||
@@ -16,6 +16,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace director
|
} // namespace director
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // DIRECTOR_H
|
#endif // DIRECTOR_H
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <simulator/scene.h>
|
#include <simulator/scene.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
class Goal
|
class Goal
|
||||||
: public simulator::Scene {
|
: public simulator::Scene {
|
||||||
@@ -12,6 +12,6 @@ public:
|
|||||||
~Goal() = default;
|
~Goal() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef IMPLIX_H
|
#ifndef IMPLIX_H
|
||||||
#define IMPLIX_H
|
#define IMPLIX_H
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace implix {
|
namespace implix {
|
||||||
|
|
||||||
class Implix
|
class Implix
|
||||||
@@ -12,6 +12,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace implix
|
} // namespace implix
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // IMPLIX_H
|
#endif // IMPLIX_H
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _MENTAL_ENTITY_H
|
#ifndef _MENTAL_ENTITY_H
|
||||||
#define _MENTAL_ENTITY_H
|
#define _MENTAL_ENTITY_H
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
class MentalEntity
|
class MentalEntity
|
||||||
{
|
{
|
||||||
@@ -9,6 +9,6 @@ public:
|
|||||||
using Id = uint32_t;
|
using Id = uint32_t;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include <director/director.h>
|
#include <director/director.h>
|
||||||
#include <simulator/simulator.h>
|
#include <simulator/simulator.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
|
|
||||||
class Mind
|
class Mind
|
||||||
{
|
{
|
||||||
@@ -23,6 +23,6 @@ public:
|
|||||||
simulator::Simulator canvas;
|
simulator::Simulator canvas;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <user/senseApiDesc.h>
|
#include <user/senseApiDesc.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sense_api {
|
namespace sense_api {
|
||||||
|
|
||||||
class SenseApiLib
|
class SenseApiLib
|
||||||
@@ -28,10 +28,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
SenseApiLib(
|
SenseApiLib(
|
||||||
const std::string& path, void *_dlopen_handle,
|
const std::string& path, void *_dlopen_handle,
|
||||||
HK_GET_SENSE_API_DESC_FN_TYPEDEF *descFn)
|
SMO_GET_SENSE_API_DESC_FN_TYPEDEF *descFn)
|
||||||
: libraryPath(path),
|
: libraryPath(path),
|
||||||
dlopen_handle(_dlopen_handle, DlCloser()),
|
dlopen_handle(_dlopen_handle, DlCloser()),
|
||||||
HK_GET_SENSE_API_DESC_FN_NAME(descFn)
|
SMO_GET_SENSE_API_DESC_FN_NAME(descFn)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void setSenseApiDesc(const SenseApiDesc &desc)
|
void setSenseApiDesc(const SenseApiDesc &desc)
|
||||||
@@ -57,16 +57,16 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Every sense API lib is required to provide a function that returns
|
* @brief Every sense API lib is required to provide a function that returns
|
||||||
* a SenseApiDesc struct. This struct states which API the lib uses to
|
* a SenseApiDesc struct. This struct states which API the lib uses to
|
||||||
* connect Harikoff to the sense provider it supports.
|
* connect Salmanoff to the sense provider it supports.
|
||||||
*
|
*
|
||||||
* This getter function should be visible to dlsym() so that Harikoff can
|
* This getter function should be visible to dlsym() so that Salmanoff can
|
||||||
* find it in the lib after loading it, and call it.
|
* find it in the lib after loading it, and call it.
|
||||||
*/
|
*/
|
||||||
std::function<HK_GET_SENSE_API_DESC_FN_TYPEDEF>
|
std::function<SMO_GET_SENSE_API_DESC_FN_TYPEDEF>
|
||||||
HK_GET_SENSE_API_DESC_FN_NAME;
|
SMO_GET_SENSE_API_DESC_FN_NAME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Harikoff will call the `HK_GET_SENSE_API_DESC_FN_NAME` getter
|
* @brief Salmanoff will call the `SMO_GET_SENSE_API_DESC_FN_NAME` getter
|
||||||
* function and use the data it provides in order to fill out this
|
* function and use the data it provides in order to fill out this
|
||||||
* descriptor.
|
* descriptor.
|
||||||
*/
|
*/
|
||||||
@@ -80,6 +80,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // SENSE_API_PROVIDER_DESC_H
|
#endif // SENSE_API_PROVIDER_DESC_H
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <senseApis/senseApiLib.h>
|
#include <senseApis/senseApiLib.h>
|
||||||
#include <user/senseDeviceSpec.h>
|
#include <user/senseDeviceSpec.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sense_api {
|
namespace sense_api {
|
||||||
|
|
||||||
class SenseApiManager
|
class SenseApiManager
|
||||||
@@ -55,6 +55,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // SENSE_API_MANAGER_H
|
#endif // SENSE_API_MANAGER_H
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sensors/sensor.h>
|
#include <sensors/sensor.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sensors {
|
namespace sensors {
|
||||||
|
|
||||||
class Extrospector
|
class Extrospector
|
||||||
@@ -18,6 +18,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sensors
|
} // namespace sensors
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // _EXTROSPECTOR_H
|
#endif // _EXTROSPECTOR_H
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sensors/sensor.h>
|
#include <sensors/sensor.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sensors {
|
namespace sensors {
|
||||||
|
|
||||||
class Interoceptor
|
class Interoceptor
|
||||||
@@ -104,6 +104,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sensors
|
} // namespace sensors
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // _INTEROCEPTOR_H
|
#endif // _INTEROCEPTOR_H
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sensors {
|
namespace sensors {
|
||||||
|
|
||||||
class Sensor
|
class Sensor
|
||||||
@@ -16,6 +16,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sensors
|
} // namespace sensors
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // _SENSOR_H
|
#endif // _SENSOR_H
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <mentalEntity.h>
|
#include <mentalEntity.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace simulator {
|
namespace simulator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,6 +74,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace simulator
|
} // namespace simulator
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // SIMULATOR_COMMANDLIST_H
|
#endif // SIMULATOR_COMMANDLIST_H
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <mentalEntity.h>
|
#include <mentalEntity.h>
|
||||||
#include <simulator/commandList.h>
|
#include <simulator/commandList.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace simulator {
|
namespace simulator {
|
||||||
|
|
||||||
class Scene
|
class Scene
|
||||||
@@ -34,7 +34,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace simulator
|
} // namespace simulator
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <simulator/scene.h>
|
#include <simulator/scene.h>
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace simulator {
|
namespace simulator {
|
||||||
|
|
||||||
class Simulator {
|
class Simulator {
|
||||||
@@ -21,6 +21,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace simulator
|
} // namespace simulator
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|
||||||
#endif // SIMULATOR_H
|
#endif // SIMULATOR_H
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
namespace hk {
|
namespace smo {
|
||||||
namespace sense_api {
|
namespace sense_api {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,13 +92,13 @@ SenseApiLib& SenseApiManager::loadSenseApiLib(const std::string& libraryPath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize getSenseApiDescriptor
|
// Initialize getSenseApiDescriptor
|
||||||
auto func = reinterpret_cast<HK_GET_SENSE_API_DESC_FN_TYPEDEF *>(
|
auto func = reinterpret_cast<SMO_GET_SENSE_API_DESC_FN_TYPEDEF *>(
|
||||||
dlsym(dlopen_handle.get(), HK_GET_SENSE_API_DESC_FN_NAME_STR));
|
dlsym(dlopen_handle.get(), SMO_GET_SENSE_API_DESC_FN_NAME_STR));
|
||||||
if (!func)
|
if (!func)
|
||||||
{
|
{
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
std::string(__func__) + ": dlsym('"
|
std::string(__func__) + ": dlsym('"
|
||||||
HK_GET_SENSE_API_DESC_FN_NAME_STR "') failed for library '"
|
SMO_GET_SENSE_API_DESC_FN_NAME_STR "') failed for library '"
|
||||||
+ libraryPath + "'");
|
+ libraryPath + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,4 +265,4 @@ void SenseApiManager::detachAllSenseDevices(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sense_api
|
} // namespace sense_api
|
||||||
} // namespace hk
|
} // namespace smo
|
||||||
|
|||||||
Reference in New Issue
Block a user