Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adonmo/meos-cpp-example
An example C++ application built using MEOS
https://github.com/adonmo/meos-cpp-example
Last synced: about 1 month ago
JSON representation
An example C++ application built using MEOS
- Host: GitHub
- URL: https://github.com/adonmo/meos-cpp-example
- Owner: adonmo
- License: mit
- Created: 2020-07-05T12:50:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T16:02:46.000Z (over 4 years ago)
- Last Synced: 2023-10-20T16:11:20.352Z (about 1 year ago)
- Language: CMake
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# MEOS C++ example
This project shows a minimal example for how [MEOS](https://github.com/adonmo/meos) can be used in C++ projects.
## Code Snippet
```cpp
#include
#include
#include "time_utils.cpp"using namespace std;
using namespace meos;int main() {
set> instants = {
TInstant(2, unix_time_point(2012, 1, 1)),
TInstant(1, unix_time_point(2012, 1, 2)),
TInstant(4, unix_time_point(2012, 1, 3)),
TInstant(3, unix_time_point(2012, 1, 4)),
};
TSequence tseq(instants);
cout << tseq << endl;
return 0;
}
```## Building
```sh
cmake -B build -S .
cmake --build build
```Note: It is assumed you have libgeos-dev installed on your system.
## Running
```sh
./build/app
```
If you see the following output, you have succesfully ran the example application! :)
```
[2@2012-01-01T00:00:00+0000, 1@2012-01-02T00:00:00+0000, 4@2012-01-03T00:00:00+0000, 3@2012-01-04T00:00:00+0000)
```## How it works
In [CMakeLists.txt](CMakeLists.txt) file you can see that MEOS is included and linked using [CPM](https://github.com/TheLartians/CPM.cmake)
```cmake
include(cmake/CPM.cmake)CPMAddPackage(
NAME MEOS
GITHUB_REPOSITORY adonmo/meos
GIT_TAG 0.1
)
```When you run cmake build, specified version of the library is fetched and linked to the application
## Ready for more?
Of course, you can build much more useful and all sorts of complex applications using MEOS. Here are some links to help you out:- [MEOS C++ Documentation](https://adonmo.github.io/meos/)
- [MEOS Repository](https://github.com/adonmo/meos)
- [MobilityDB](https://github.com/MobilityDB/MobilityDB) and its [documentation](https://docs.mobilitydb.com/MobilityDB/master/)