Skip to content

Commit d333311

Browse files
Add methods for TypeObject registration of RPC types (#5889) (#6056)
* Add methods for TypeObject registration of RPC types (#5889) * Refs #23268. Add methods for TypeObject registration of RPC types. Signed-off-by: Miguel Company <[email protected]> * Refs #23268. Add documentation regarding auto-generated code. Signed-off-by: Miguel Company <[email protected]> * Refs #23268. Linters. Signed-off-by: Miguel Company <[email protected]> * Refs #23268. RPC types are final. Signed-off-by: Miguel Company <[email protected]> * Apply suggestion Co-authored-by: Carlos Espinoza Curto <[email protected]> Signed-off-by: Miguel Company <[email protected]> * Refs #23268. Update versions.md Signed-off-by: Miguel Company <[email protected]> --------- Signed-off-by: Miguel Company <[email protected]> Co-authored-by: Carlos Espinoza Curto <[email protected]> (cherry picked from commit d1545d1) # Conflicts: # versions.md * Fix conflicts Signed-off-by: Miguel Company <[email protected]> --------- Signed-off-by: Miguel Company <[email protected]> Co-authored-by: Miguel Company <[email protected]>
1 parent 00e68df commit d333311

File tree

5 files changed

+969
-0
lines changed

5 files changed

+969
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
// Copyright 2025 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/**
16+
* @file RPCTypeObjectSupport.hpp
17+
*/
18+
19+
#ifndef FASTDDS_DDS_RPC__RPCTYPEOBJECTSUPPORT_HPP
20+
#define FASTDDS_DDS_RPC__RPCTYPEOBJECTSUPPORT_HPP
21+
22+
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
23+
#include <fastdds/fastdds_dll.hpp>
24+
25+
namespace eprosima {
26+
namespace fastdds {
27+
namespace dds {
28+
namespace rpc {
29+
30+
/**
31+
* @brief Register RpcException related TypeIdentifier.
32+
* Fully-descriptive TypeIdentifiers are directly registered.
33+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
34+
* indirectly registered as well.
35+
*
36+
* @param[out] type_ids TypeIdentifier of the registered type.
37+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
38+
* Invalid TypeIdentifier is returned in case of error.
39+
*/
40+
FASTDDS_EXPORTED_API void register_RpcException_type_identifier(
41+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
42+
43+
/**
44+
* @brief Register RpcBrokenPipeException related TypeIdentifier.
45+
* Fully-descriptive TypeIdentifiers are directly registered.
46+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
47+
* indirectly registered as well.
48+
*
49+
* @param[out] type_ids TypeIdentifier of the registered type.
50+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
51+
* Invalid TypeIdentifier is returned in case of error.
52+
*/
53+
FASTDDS_EXPORTED_API void register_RpcBrokenPipeException_type_identifier(
54+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
55+
56+
/**
57+
* @brief Register RpcStatusCode related TypeIdentifier.
58+
* Fully-descriptive TypeIdentifiers are directly registered.
59+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
60+
* indirectly registered as well.
61+
*
62+
* @param[out] type_ids TypeIdentifier of the registered type.
63+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
64+
* Invalid TypeIdentifier is returned in case of error.
65+
*/
66+
FASTDDS_EXPORTED_API void register_RpcStatusCode_type_identifier(
67+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
68+
69+
/**
70+
* @brief Register RpcFeedCancelledException related TypeIdentifier.
71+
* Fully-descriptive TypeIdentifiers are directly registered.
72+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
73+
* indirectly registered as well.
74+
*
75+
* @param[out] type_ids TypeIdentifier of the registered type.
76+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
77+
* Invalid TypeIdentifier is returned in case of error.
78+
*/
79+
FASTDDS_EXPORTED_API void register_RpcFeedCancelledException_type_identifier(
80+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
81+
82+
/**
83+
* @brief Register RpcOperationError related TypeIdentifier.
84+
* Fully-descriptive TypeIdentifiers are directly registered.
85+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
86+
* indirectly registered as well.
87+
*
88+
* @param[out] type_ids TypeIdentifier of the registered type.
89+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
90+
* Invalid TypeIdentifier is returned in case of error.
91+
*/
92+
FASTDDS_EXPORTED_API void register_RpcOperationError_type_identifier(
93+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
94+
95+
/**
96+
* @brief Register RemoteExceptionCode_t related TypeIdentifier.
97+
* Fully-descriptive TypeIdentifiers are directly registered.
98+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
99+
* indirectly registered as well.
100+
*
101+
* @param[out] type_ids TypeIdentifier of the registered type.
102+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
103+
* Invalid TypeIdentifier is returned in case of error.
104+
*/
105+
FASTDDS_EXPORTED_API void register_RemoteExceptionCode_t_type_identifier(
106+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
107+
108+
/**
109+
* @brief Register RpcRemoteException related TypeIdentifier.
110+
* Fully-descriptive TypeIdentifiers are directly registered.
111+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
112+
* indirectly registered as well.
113+
*
114+
* @param[out] type_ids TypeIdentifier of the registered type.
115+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
116+
* Invalid TypeIdentifier is returned in case of error.
117+
*/
118+
FASTDDS_EXPORTED_API void register_RpcRemoteException_type_identifier(
119+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
120+
121+
/**
122+
* @brief Register RpcTimeoutException related TypeIdentifier.
123+
* Fully-descriptive TypeIdentifiers are directly registered.
124+
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
125+
* indirectly registered as well.
126+
*
127+
* @param[out] type_ids TypeIdentifier of the registered type.
128+
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
129+
* Invalid TypeIdentifier is returned in case of error.
130+
*/
131+
FASTDDS_EXPORTED_API void register_RpcTimeoutException_type_identifier(
132+
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
133+
134+
} // namespace rpc
135+
} // namespace dds
136+
} // namespace fastdds
137+
} // namespace eprosima
138+
139+
#endif // FASTDDS_DDS_RPC__RPCTYPEOBJECTSUPPORT_HPP

src/cpp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ set(${PROJECT_NAME}_source_files
7676
fastdds/rpc/ServiceImpl.cpp
7777
fastdds/rpc/ReplierImpl.cpp
7878
fastdds/rpc/RequesterImpl.cpp
79+
fastdds/rpc/RPCTypeObjectSupport.cpp
7980
fastdds/rpc/ServiceTypeSupport.cpp
8081
fastdds/subscriber/DataReader.cpp
8182
fastdds/subscriber/DataReaderImpl.cpp

0 commit comments

Comments
 (0)