From 2f10ae08d435b12e1798d93e0b90605717c66081 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 17 Aug 2009 13:33:27 -0700 Subject: Support for marshalling pointers / intptr_t in Parcel. Some refactoring to eliminate code duplication in Parcel implementation. --- include/binder/Parcel.h | 11 +++++++++++ include/utils/Debug.h | 2 ++ 2 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h index 58c2d9a..ba6c711 100644 --- a/include/binder/Parcel.h +++ b/include/binder/Parcel.h @@ -74,6 +74,7 @@ public: status_t writeInt64(int64_t val); status_t writeFloat(float val); status_t writeDouble(double val); + status_t writeIntPtr(intptr_t val); status_t writeCString(const char* str); status_t writeString8(const String8& str); status_t writeString16(const String16& str); @@ -109,6 +110,8 @@ public: status_t readFloat(float *pArg) const; double readDouble() const; status_t readDouble(double *pArg) const; + intptr_t readIntPtr() const; + status_t readIntPtr(intptr_t *pArg) const; const char* readCString() const; String8 readString8() const; @@ -163,6 +166,14 @@ private: void initState(); void scanForFds() const; + template + status_t readAligned(T *pArg) const; + + template T readAligned() const; + + template + status_t writeAligned(T val); + status_t mError; uint8_t* mData; size_t mDataSize; diff --git a/include/utils/Debug.h b/include/utils/Debug.h index 21d04bd..d9ed32d 100644 --- a/include/utils/Debug.h +++ b/include/utils/Debug.h @@ -29,6 +29,8 @@ template<> struct CompileTimeAssert {}; #define COMPILE_TIME_ASSERT(_exp) \ template class CompileTimeAssert< (_exp) >; #endif +#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ + CompileTimeAssert<( _exp )>(); // --------------------------------------------------------------------------- -- cgit v1.1