Skip to content

Commit 574dab1

Browse files
committed
Remove dead code from tyndall
Due to the updates in node_comm, the iterate and typevals utilities have been moved into libblunux and they've been also made macos/clang compatible. In addition to this, all zmq functionlity has been replaced with azmq so there is no need for the zmq_proto utility either.
1 parent 830a704 commit 574dab1

File tree

14 files changed

+1
-899
lines changed

14 files changed

+1
-899
lines changed

README.md

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,6 @@ make tests
4444

4545
# Highlights
4646

47-
## meta/iterate
48-
49-
Function that calls the given callback with integral constants from 0 to the specified index.
50-
Useful for iterating at compile time.
51-
52-
Example:
53-
```cpp
54-
#include <tyndall/meta/iterate.h>
55-
56-
iterate<10>(
57-
[](auto index){
58-
// index = std::integral_constant<int, 0>(), std::integral_constant<int, 1>(), ... ,std::integral_constant<int, 9>()
59-
static_assert((index >= 0) && (index < 10));
60-
printf("%d ", index()); // 0 1 2 3 4 5 6 7 8 9
61-
});
62-
```
63-
6447
## meta/strval
6548

6649
compile time string which ensures "string A"\_strval and "string A"\_strval have the same type,
@@ -75,67 +58,6 @@ printf("%s\n", ("belle"_strval).replace<'e', 'a'>().c_str());
7558
printf("%s\n", to_strval<42>::c_str());
7659
```
7760
78-
## meta/typevals
79-
Container where entries can have different types.
80-
81-
Example:
82-
```cpp
83-
#include <tyndall/meta/typevals.h>
84-
85-
struct A{int a; float b;};
86-
struct B{double x; char y; char z;};
87-
88-
static constexpr auto tv = typevals{} + 5 + A{4,2} + B{3,9,1};
89-
static_assert(tv.size() == 3);
90-
91-
constexpr auto A42 = tv.get<1>();
92-
static_assert(A42.b == 2);
93-
constexpr auto B391 = tv[std::integral_constant<int, 2>()];
94-
static_assert(B391.x == 3);
95-
```
96-
97-
## zmq\_proto
98-
99-
[ZeroMQ](https://zeromq.org/) ([libzmq](https://github.com/zeromq/libzmq)) / [Protobuf](https://developers.google.com/protocol-buffers) based tcp communication.
100-
101-
Example:
102-
103-
### Publisher
104-
```cpp
105-
#include <tyndall/proto/zmq_proto.h>
106-
107-
zmq_proto::context_t context{1};
108-
zmq_proto::socket_t<zmq_proto::PUB> socket(context, "tcp://*:5444");
109-
110-
google::protobuf::Int32Value msg;
111-
msg.set_value(42);
112-
113-
int rc = zmq_proto::send(msg, socket);
114-
if (rc != 0)
115-
printf("errno: %s\n", strerror(errno));
116-
```
117-
118-
### Subscriber
119-
```cpp
120-
#include <tyndall/proto/zmq_proto.h>
121-
122-
zmq_proto::context_t context{1};
123-
zmq_proto::socket_t<zmq_proto::SUB> socket(context, "tcp://127.0.0.1:5444");
124-
125-
while(1)
126-
{
127-
google::protobuf::Int32Value msg;
128-
129-
int rc = zmq_proto::recv(msg, socket);
130-
if (rc != 0)
131-
{
132-
printf("errno: %s\n", strerror(errno));
133-
exit(1);
134-
}
135-
}
136-
```
137-
Full examples in [examples/proto/zmq\_proto\_pub.cpp](examples/proto/zmq_proto_pub.cpp) and [examples/proto/zmq\_proto\_sub.cpp](examples/proto/zmq_proto_sub.cpp).
138-
13961
## ros\_context
14062
A wrapper around ros.
14163
It provides a minimal of lazy methods for sending and receiving ros messages and service calls.

examples/log/C++.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/log/C.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#define LOG_PRINTF
22
// #define LOG_FMT
3-
#include <tyndall/log/log.h>
4-
53
#include <signal.h>
4+
#include <tyndall/log/log.h>
65
#include <unistd.h>
76

87
sig_atomic_t run = 1;

examples/meta.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <cstdio>
2-
#include <tyndall/meta/iterate.h>
32
#include <tyndall/meta/strval.h>
4-
#include <tyndall/meta/typevals.h>
53
#include <typeinfo>
64

75
template <typename T> struct tstruct {
@@ -21,43 +19,5 @@ int main() {
2119
("///hei din sei"_strval).remove_leading<'/'>().c_str());
2220
printf("to_strval: %s\n", to_strval<42>::c_str());
2321

24-
{
25-
printf("typevals:\n");
26-
{
27-
struct A {
28-
int a;
29-
float b;
30-
};
31-
struct B {
32-
int a;
33-
float b;
34-
};
35-
static constexpr auto col = typevals{} + 5 + A{4, 2} + B{3, 9};
36-
printf("col size: %d\n", col.size());
37-
38-
constexpr auto res = col.get<2>();
39-
printf("col res: %s\n", typeid(res).name());
40-
constexpr auto res2 = col[std::integral_constant<int, 2>()];
41-
printf("col res2: %s\n", typeid(res2).name());
42-
}
43-
44-
{
45-
static constexpr auto c = typevals{} + tstruct<int>{5};
46-
constexpr auto res = c.get<0>();
47-
printf("c res: %s\n", typeid(res).name());
48-
decltype(res)::Type t;
49-
(void)sizeof(t);
50-
}
51-
52-
{
53-
static constexpr auto c = typevals{} + tstruct<int>{-5} +
54-
tstruct<float>{3} + tstruct<unsigned>{8};
55-
56-
iterate<c.size()>([](auto index) {
57-
printf("iteration %d: %s\n", index(), typeid(index).name());
58-
});
59-
}
60-
}
61-
6222
return 0;
6323
}

examples/proto/binlog_read.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

examples/proto/binlog_write.cpp

Lines changed: 0 additions & 33 deletions
This file was deleted.

examples/proto/zmq_proto_pub.cpp

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/proto/zmq_proto_sub.cpp

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/meta/typevals.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)