summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2009-08-17 13:33:27 -0700
committerAndreas Huber <andih@google.com>2009-08-17 15:31:25 -0700
commit84a6d041e2c69d4d0b69269a0b59e725c9f119a3 (patch)
tree6841d5b1d696e27f66c30ede34c73d30cf5cc5c3 /include
parent7f87b14a5b569b5526725fcf2d942156948d064c (diff)
downloadframeworks_native-84a6d041e2c69d4d0b69269a0b59e725c9f119a3.zip
frameworks_native-84a6d041e2c69d4d0b69269a0b59e725c9f119a3.tar.gz
frameworks_native-84a6d041e2c69d4d0b69269a0b59e725c9f119a3.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.h11
-rw-r--r--include/utils/Debug.h2
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 )>();
// ---------------------------------------------------------------------------