diff options
author | Andreas Huber <andih@google.com> | 2009-08-17 13:33:27 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-08-17 15:31:25 -0700 |
commit | 2f10ae08d435b12e1798d93e0b90605717c66081 (patch) | |
tree | 30d50a2897e1f0a1835e72c8fa7b057c98ad8c2e /include | |
parent | 01f750d6fa03f16ef93802618a6ccf8b353ae8e2 (diff) | |
download | frameworks_base-2f10ae08d435b12e1798d93e0b90605717c66081.zip frameworks_base-2f10ae08d435b12e1798d93e0b90605717c66081.tar.gz frameworks_base-2f10ae08d435b12e1798d93e0b90605717c66081.tar.bz2 |
Support for marshalling pointers / intptr_t in Parcel.
Some refactoring to eliminate code duplication in Parcel implementation.
Diffstat (limited to 'include')
-rw-r--r-- | include/binder/Parcel.h | 11 | ||||
-rw-r--r-- | include/utils/Debug.h | 2 |
2 files changed, 13 insertions, 0 deletions
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<class T> + status_t readAligned(T *pArg) const; + + template<class T> T readAligned() const; + + template<class T> + 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<true> {}; #define COMPILE_TIME_ASSERT(_exp) \ template class CompileTimeAssert< (_exp) >; #endif +#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ + CompileTimeAssert<( _exp )>(); // --------------------------------------------------------------------------- |