summaryrefslogtreecommitdiff
path: root/libs/binder/include/binder/ParcelFileDescriptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/include/binder/ParcelFileDescriptor.h')
-rw-r--r--libs/binder/include/binder/ParcelFileDescriptor.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/binder/include/binder/ParcelFileDescriptor.h b/libs/binder/include/binder/ParcelFileDescriptor.h
index 9896fd7a51..4635ad84c6 100644
--- a/libs/binder/include/binder/ParcelFileDescriptor.h
+++ b/libs/binder/include/binder/ParcelFileDescriptor.h
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-#pragma once
+#ifndef ANDROID_PARCEL_FILE_DESCRIPTOR_H_
+#define ANDROID_PARCEL_FILE_DESCRIPTOR_H_
#include <android-base/unique_fd.h>
#include <binder/Parcel.h>
@@ -30,8 +31,7 @@ class ParcelFileDescriptor : public android::Parcelable {
public:
ParcelFileDescriptor();
explicit ParcelFileDescriptor(android::base::unique_fd fd);
- ParcelFileDescriptor(ParcelFileDescriptor&& other) noexcept : mFd(std::move(other.mFd)) { }
- ParcelFileDescriptor& operator=(ParcelFileDescriptor&& other) noexcept = default;
+ ParcelFileDescriptor(ParcelFileDescriptor&& other) : mFd(std::move(other.mFd)) { }
~ParcelFileDescriptor() override;
int get() const { return mFd.get(); }
@@ -43,22 +43,22 @@ public:
android::status_t readFromParcel(const android::Parcel* parcel) override;
inline bool operator!=(const ParcelFileDescriptor& rhs) const {
- return mFd.get() != rhs.mFd.get();
+ return mFd != rhs.mFd;
}
inline bool operator<(const ParcelFileDescriptor& rhs) const {
- return mFd.get() < rhs.mFd.get();
+ return mFd < rhs.mFd;
}
inline bool operator<=(const ParcelFileDescriptor& rhs) const {
- return mFd.get() <= rhs.mFd.get();
+ return mFd <= rhs.mFd;
}
inline bool operator==(const ParcelFileDescriptor& rhs) const {
- return mFd.get() == rhs.mFd.get();
+ return mFd == rhs.mFd;
}
inline bool operator>(const ParcelFileDescriptor& rhs) const {
- return mFd.get() > rhs.mFd.get();
+ return mFd > rhs.mFd;
}
inline bool operator>=(const ParcelFileDescriptor& rhs) const {
- return mFd.get() >= rhs.mFd.get();
+ return mFd >= rhs.mFd;
}
private:
android::base::unique_fd mFd;
@@ -66,3 +66,5 @@ private:
} // namespace os
} // namespace android
+
+#endif // ANDROID_OS_PARCEL_FILE_DESCRIPTOR_H_