Skip to content

Commit db370bb

Browse files
Danipizarichiware
authored andcommitted
[#23141] Review changes
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent 36010cf commit db370bb

8 files changed

Lines changed: 54 additions & 38 deletions

File tree

fastdds_python/src/swig/fastdds/rtps/common/BinaryProperty.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%}
1818

1919
// Ignore overloaded constructor and methods that have no effect on target language
20-
%ignore eprosima::fastdds::rtps::BinaryProperty::BinaryProperty(BinaryProperty &&);
20+
%copyctor eprosima::fastdds::rtps::BinaryProperty;
2121
%ignore eprosima::fastdds::rtps::BinaryProperty::name(std::string &&);
2222
%ignore eprosima::fastdds::rtps::BinaryProperty::value(std::vector<uint8_t> &&);
2323
%ignore eprosima::fastdds::rtps::BinaryProperty::propagate() const;

fastdds_python/src/swig/fastdds/rtps/common/Locator.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%}
1818

1919
// Ignore overloaded constructor and methods that have no effect on target language
20-
%ignore eprosima::fastdds::rtps::Locator_t::Locator_t(Locator_t&&);
20+
%copyctor eprosima::fastdds::rtps::Locator_t;
2121
%ignore eprosima::fastdds::rtps::operator <<(std::ostream&, const Locator_t&);
2222
%ignore eprosima::fastdds::rtps::operator >>(std::istream&, Locator_t&);
2323
%ignore eprosima::fastdds::rtps::operator ==(const Locator_t&, const Locator_t&);

fastdds_python/src/swig/fastdds/rtps/common/Property.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%}
1818

1919
// Ignore overloaded constructor and methods that have no effect on target language
20-
%ignore eprosima::fastdds::rtps::Property::Property(Property &&);
20+
%copyctor eprosima::fastdds::rtps::Property;
2121
%ignore eprosima::fastdds::rtps::Property::name(std::string &&);
2222
%ignore eprosima::fastdds::rtps::Property::value(std::string &&);
2323
%ignore eprosima::fastdds::rtps::Property::propagate() const;

fastdds_python/src/swig/fastdds/rtps/common/SampleIdentity.i

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%}
1818

1919
// Ignore overloaded constructor and methods that have no effect on target language
20-
//%ignore eprosima::fastdds::rtps::SampleIdentity::SampleIdentity(SampleIdentity &&);
20+
%copyctor eprosima::fastdds::rtps::SampleIdentity;
2121
%ignore eprosima::fastdds::rtps::SampleIdentity::writer_guid(GUID_t &&);
2222
%ignore eprosima::fastdds::rtps::SampleIdentity::writer_guid() const;
2323
%ignore eprosima::fastdds::rtps::SampleIdentity::sequence_number(SequenceNumber_t &&);
@@ -28,12 +28,3 @@
2828
%ignore operator <<(std::ostream& output, const SampleIdentity& sid);
2929

3030
%include "fastdds/rtps/common/SampleIdentity.hpp"
31-
32-
// Copy constructor
33-
%extend eprosima::fastdds::rtps::SampleIdentity {
34-
35-
SampleIdentity(const eprosima::fastdds::rtps::SampleIdentity& sample_identity_)
36-
{
37-
return new eprosima::fastdds::rtps::SampleIdentity(sample_identity_);
38-
}
39-
}

fastdds_python/src/swig/fastdds/rtps/common/Token.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
%}
1818

1919
// Ignore overloaded constructor and methods that have no effect on target language
20-
%ignore eprosima::fastdds::rtps::DataHolder::DataHolder(DataHolder &&);
20+
%copyctor eprosima::fastdds::rtps::DataHolder;
2121
%ignore eprosima::fastdds::rtps::DataHolderHelper::DataHolderHelper(DataHolderHelper &&);
2222
%ignore eprosima::fastdds::rtps::DataHolderHelper::find_property_value(const DataHolder& data_holder, const std::string& name);
2323
%ignore eprosima::fastdds::rtps::DataHolderHelper::find_property(const DataHolder& data_holder, const std::string& name);

fastdds_python/src/swig/fastdds/rtps/common/WriteParams.i

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@
1616
#include "fastdds/rtps/common/WriteParams.hpp"
1717
%}
1818

19+
%copyctor eprosima::fastdds::rtps::WriteParams;
1920

2021
%include "fastdds/rtps/common/WriteParams.hpp"
21-
22-
23-
// methods as Python attributes
24-
%extend eprosima::fastdds::rtps::WriteParams
25-
{
26-
27-
eprosima::fastdds::rtps::SampleIdentity _get_sample_identity()
28-
{
29-
return $self->sample_identity();
30-
}
31-
void _set_sample_identity(const eprosima::fastdds::rtps::SampleIdentity& sid)
32-
{
33-
$self->sample_identity(sid);
34-
}
35-
36-
eprosima::fastdds::rtps::SampleIdentity _get_related_sample_identity()
37-
{
38-
return $self->related_sample_identity();
39-
}
40-
void _set_related_sample_identity(const eprosima::fastdds::rtps::SampleIdentity& sid)
41-
{
42-
$self->related_sample_identity(sid);
43-
}
44-
}

output.txt

Whitespace-only changes.

search.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import os
2+
import re
3+
4+
# Define the pattern for matching the lines
5+
pattern = re.compile(r'^%ignore\s+[a-zA-Z0-9_::]+::[a-zA-Z0-9_]+\(.*&&;\)$')
6+
7+
# Function to search files recursively
8+
def search_files_in_directory(directory):
9+
matches = []
10+
11+
# Walk through all files in the directory and its subdirectories
12+
for root, _, files in os.walk(directory):
13+
for file in files:
14+
file_path = os.path.join(root, file)
15+
# Skip files that are not relevant (e.g., non-text files)
16+
if not file.endswith((".txt", ".cpp", ".h")):
17+
continue
18+
19+
# Open and read each file
20+
try:
21+
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
22+
lines = f.readlines()
23+
for line in lines:
24+
# Check if the line matches the pattern
25+
if pattern.match(line.strip()):
26+
matches.append(line.strip())
27+
except Exception as e:
28+
print(f"Could not read file {file_path}: {e}")
29+
30+
return matches
31+
32+
# Write the matches to an output file
33+
def write_matches_to_file(matches):
34+
with open('output.txt', 'w', encoding='utf-8') as output_file:
35+
for match in matches:
36+
output_file.write(match + '\n')
37+
38+
# Main function
39+
if __name__ == "__main__":
40+
directory = '.' # Current directory
41+
print("Searching for pattern in files...")
42+
matches = search_files_in_directory(directory)
43+
44+
if matches:
45+
write_matches_to_file(matches)
46+
print(f"Found {len(matches)} matching lines. Results saved in 'output.txt'.")
47+
else:
48+
print("No matches found.")

0 commit comments

Comments
 (0)