GCC Code Coverage Report


Directory: ./
File: ecapp/SwappedSync.h
Date: 2026-09-03 16:05:57
Exec Total Coverage
Lines: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*****************************************************************************
2 *
3 * This file is part of the ecapp library (EtherCAT application devices).
4 *
5 * Copyright (C) 2026 Florian Pose <fp@igh.de>
6 *
7 * The ecapp library is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation, version 3 of the
10 * License.
11 *
12 * The ecapp library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with the ecapp library. If not, see
19 * <https://www.gnu.org/licenses/>.
20 *
21 ****************************************************************************/
22
23 #ifndef ECAPP_SWAPPEDSYNC_H
24 #define ECAPP_SWAPPEDSYNC_H
25
26 /****************************************************************************/
27
28 #include "ecapp/Mode.h"
29 #include "ecapp_export.h"
30
31 #include <ecrt.h> // EtherCAT realtime interface
32
33 /****************************************************************************/
34
35 namespace EcApp {
36
37 /** In Simulation mode, swaps EC_DIR_INPUT/EC_DIR_OUTPUT in a sync manager
38 * table so a device's outputs loop back as its own inputs, allowing
39 * control-software tests without a real bus. */
40 template <Mode mode>
41 class ECAPP_EXPORT SwappedSync
42 {
43 public:
44 explicit SwappedSync(ec_sync_info_t *);
45 SwappedSync() = delete;
46 ~SwappedSync();
47
48 const ec_sync_info_t *getSync() const { return sync; }
49
50 private:
51 ec_sync_info_t *sync;
52 };
53
54 } // namespace EcApp
55
56 #endif // ECAPP_SWAPPEDSYNC_H
57
58 /****************************************************************************/
59