AuboStudio SDK  0.6.3
tcp_contribution_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_TCP_CONTRIBUTION_MODEL_H
2#define AUBO_SCOPE_TCP_CONTRIBUTION_MODEL_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * @ingroup InstallationApi
12 * <p>
13 * This interface provides functionality for adding, updating and removing TCPs
14 * in AuboScope.
15 * </p>
16 *
17 * <b>Note: </b> This interface must only be used in an installation
18 * contribution/
19 */
21{
22public:
26
27 /**
28 * @ingroup TcpContributionModel
29 * @ref TCP
30 * Add a TCP to the current AuboScope installation. This makes it selectable
31 * by the end user. The TCP is not modifiable by the end user.
32 *
33 * @param idKey The key to identify this TCP by. The key is for this AuboCap
34 * only, i.e. it only has to be unique for this AuboCap and not "globally"
35 * for other aubo_studio plugins.
36 * @param suggested_name Suggested name for the tcp/ Valid names must match
37 * regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. The final
38 * name can be retrieved from the returned TCP instance.
39 * @param offset The offset of the TCP with respect to the tool output
40 * flange
41 * @return The TCP created and registered in AuboScope.
42 * @throws TCPAlreadyAddedException If called twice using the same
43 * <code>idKey</code>. Use {@link #getTCP(std::string)} to check if the TCP
44 * has already been added to the current installation. Use {@link
45 * #updateTCP(std::string, Pose)} to update the TCP if the offset of the TCP
46 * has changed.
47 * @throws IllegalTCPNameException If the suggested name does not match
48 * required regex.
49 * @throws IllegalArgumentException If the pose specified for the offset is
50 * not inside the valid range of a TCP offset as defined by AuboScope.
51 */
52 TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name,
53 const std::vector<double> &offset);
54
55 /**
56 * @ingroup TcpContributionModel
57 * @ref TCP
58 * Returns the TCP previously added by this AuboCap using the same
59 * <code>idKey</code>. Use this to verify if the TCP is present in the
60 * current installation.
61 *
62 * @param idKey The key to identify this TCP by.
63 * @return The TCP previously added by this AuboCap.
64 * Returns <code>null</code> if no TCP exists in current
65 * installation.
66 */
67 TCPPtr getTcp(const std::string &idKey);
68
69 /**
70 * @ingroup TcpContributionModel
71 * Update the offset of a TCP already added by this AuboCap.
72 *
73 * @param idKey The key to identify the tcp/ A TCP must have been added
74 * prior to this method call using the same key.
75 * @param newOffset The new offset to set for the TCP with respect to the
76 * tool output flange.
77 * @throws TCPNotFoundException If no TCP exists with the provided
78 * <code>idKey</code>.
79 * @throws IllegalArgumentException If the pose specified for the offset is
80 * not inside the valid range of a TCP offset as defined by AuboScope.
81 */
82 void updateTcp(const std::string &idKey,
83 const std::vector<double> &newOffset);
84
85 /**
86 * @ingroup TcpContributionModel
87 * Remove a TCP added by this AuboCap from AuboScope. Program nodes using
88 * the TCP will be become undefined because the TCP is no longer resolvable.
89 *
90 * @param idKey The key used to add the TCP with.
91 * @throws TCPNotFoundException If no TCP exists with the provided
92 * <code>idKey</code>.
93 */
94 void removeTcp(const std::string &idKey);
95
96private:
97 friend class DataSwitch;
99 void *d_{ nullptr };
100};
101
102} // namespace aubo_scope
103} // namespace arcs
104
105#endif // TCPCONTRIBUTIONMODEL_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
TCPPtr getTcp(const std::string &idKey)
TCP Returns the TCP previously added by this AuboCap using the same idKey.
TcpContributionModel(TcpContributionModel &&f)
void removeTcp(const std::string &idKey)
Remove a TCP added by this AuboCap from AuboScope.
TcpContributionModel(TcpContributionModel &f)
TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name, const std::vector< double > &offset)
TCP Add a TCP to the current AuboScope installation.
void updateTcp(const std::string &idKey, const std::vector< double > &newOffset)
Update the offset of a TCP already added by this AuboCap.