fsfw-from-zero/main.cpp

24 lines
628 B
C++
Raw Normal View History

2022-10-04 10:26:12 +02:00
#include "fsfw/objectmanager.h"
2022-10-04 10:35:03 +02:00
#include <iostream>
2022-10-04 10:26:12 +02:00
#include <iomanip>
2022-09-28 19:44:30 +02:00
2022-09-02 09:07:20 +02:00
using namespace std;
2022-10-04 10:26:12 +02:00
class MySystemObject: public SystemObject {
public:
2022-10-04 10:35:03 +02:00
MySystemObject(): SystemObject(0x10101010) {}
2022-10-04 10:26:12 +02:00
ReturnValue_t initialize() override {
cout << "MySystemObject::initialize: Custom init" << endl;
}
};
2022-09-02 09:07:20 +02:00
int main() {
2022-10-04 11:09:29 +02:00
new MySystemObject();
2022-10-04 10:35:03 +02:00
auto* objManager = ObjectManager::instance();
2022-10-04 11:09:29 +02:00
objManager->initialize();
auto* mySysObj = objManager->get<MySystemObject>(0x10101010);
2022-10-04 10:35:03 +02:00
cout << "Object ID: " << setfill('0') << hex << "0x" << setw(8) <<
2022-10-04 10:26:12 +02:00
mySysObj->getObjectId() << endl;
2022-10-04 10:35:03 +02:00
return 0;
2022-09-28 14:35:09 +02:00
}