Style cleanup. No functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34152 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-20 11:04:12 +00:00
parent 1c61ec1aad
commit 395fb0895f
2 changed files with 392 additions and 330 deletions
+108 -59
View File
@@ -1,9 +1,10 @@
/*
* Copyright 2005-2007, Ingo Weinhold, [email protected]. All rights reserved.
* Copyright 2005-2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef KMESSAGE_H
#define KMESSAGE_H
#ifndef _KERNEL_UTIL_KMESSAGE_H
#define _KERNEL_UTIL_KMESSAGE_H
#include <string.h>
@@ -16,12 +17,13 @@
class BMessage;
namespace BPrivate {
class KMessageField;
class MessageAdapter;
// KMessage
class KMessage {
public:
enum {
@@ -32,14 +34,16 @@ public:
KMESSAGE_FLAG_MASK = 0x07,
};
public:
KMessage();
KMessage(uint32 what);
~KMessage();
status_t SetTo(uint32 what, uint32 flags = 0);
status_t SetTo(void *buffer, int32 bufferSize, uint32 what,
uint32 flags = 0);
status_t SetTo(const void *buffer, int32 bufferSize = -1);
status_t SetTo(void* buffer, int32 bufferSize,
uint32 what, uint32 flags = 0);
status_t SetTo(const void* buffer,
int32 bufferSize = -1);
void Unset();
void SetWhat(uint32 what);
@@ -49,18 +53,22 @@ public:
int32 BufferCapacity() const;
int32 ContentSize() const;
status_t AddField(const char *name, type_code type, int32 elementSize = -1,
status_t AddField(const char* name, type_code type,
int32 elementSize = -1,
KMessageField* field = NULL);
status_t FindField(const char *name, KMessageField *field) const;
status_t FindField(const char* name,
KMessageField* field) const;
status_t FindField(const char* name, type_code type,
KMessageField* field) const;
status_t GetNextField(KMessageField* field) const;
bool IsEmpty() const;
status_t AddData(const char *name, type_code type, const void *data,
int32 numBytes, bool isFixedSize = true);
status_t AddArray(const char *name, type_code type, const void *data,
int32 elementSize, int32 elementCount);
status_t AddData(const char* name, type_code type,
const void* data, int32 numBytes,
bool isFixedSize = true);
status_t AddArray(const char* name, type_code type,
const void* data, int32 elementSize,
int32 elementCount);
inline status_t AddBool(const char* name, bool value);
inline status_t AddInt8(const char* name, int8 value);
inline status_t AddInt16(const char* name, int16 value);
@@ -71,39 +79,55 @@ public:
status_t FindData(const char* name, type_code type,
const void** data, int32* numBytes) const;
status_t FindData(const char *name, type_code type, int32 index,
const void **data, int32 *numBytes) const;
status_t FindData(const char* name, type_code type,
int32 index, const void** data,
int32* numBytes) const;
inline status_t FindBool(const char* name, bool* value) const;
inline status_t FindBool(const char *name, int32 index, bool *value) const;
inline status_t FindBool(const char* name, int32 index,
bool* value) const;
inline status_t FindInt8(const char* name, int8* value) const;
inline status_t FindInt8(const char *name, int32 index, int8 *value) const;
inline status_t FindInt8(const char* name, int32 index,
int8* value) const;
inline status_t FindInt16(const char* name, int16* value) const;
inline status_t FindInt16(const char *name, int32 index, int16 *value) const;
inline status_t FindInt16(const char* name, int32 index,
int16* value) const;
inline status_t FindInt32(const char* name, int32* value) const;
inline status_t FindInt32(const char *name, int32 index, int32 *value) const;
inline status_t FindInt32(const char* name, int32 index,
int32* value) const;
inline status_t FindInt64(const char* name, int64* value) const;
inline status_t FindInt64(const char *name, int32 index, int64 *value) const;
inline status_t FindPointer(const char *name, void** value) const;
inline status_t FindInt64(const char* name, int32 index,
int64* value) const;
inline status_t FindPointer(const char* name,
void** value) const;
inline status_t FindPointer(const char* name, int32 index,
void** value) const;
inline status_t FindString(const char *name, const char **value) const;
inline status_t FindString(const char* name,
const char** value) const;
inline status_t FindString(const char* name, int32 index,
const char** value) const;
inline bool GetBool(const char* name, bool defaultValue) const;
inline bool GetBool(const char* name, int32 index, bool defaultValue) const;
inline int8 GetInt8(const char* name, int8 defaultValue) const;
inline int8 GetInt8(const char* name, int32 index, int8 defaultValue) const;
inline int16 GetInt16(const char* name, int16 defaultValue) const;
inline bool GetBool(const char* name,
bool defaultValue) const;
inline bool GetBool(const char* name, int32 index,
bool defaultValue) const;
inline int8 GetInt8(const char* name,
int8 defaultValue) const;
inline int8 GetInt8(const char* name, int32 index,
int8 defaultValue) const;
inline int16 GetInt16(const char* name,
int16 defaultValue) const;
inline int16 GetInt16(const char* name, int32 index,
int16 defaultValue) const;
inline int32 GetInt32(const char* name, int32 defaultValue) const;
inline int32 GetInt32(const char* name,
int32 defaultValue) const;
inline int32 GetInt32(const char* name, int32 index,
int32 defaultValue) const;
inline int64 GetInt64(const char* name, int64 defaultValue) const;
inline int64 GetInt64(const char* name,
int64 defaultValue) const;
inline int64 GetInt64(const char* name, int32 index,
int64 defaultValue) const;
inline void* GetPointer(const char* name, const void* defaultValue) const;
inline void* GetPointer(const char* name,
const void* defaultValue) const;
inline void* GetPointer(const char* name, int32 index,
const void* defaultValue) const;
inline const char* GetString(const char* name,
@@ -112,8 +136,8 @@ public:
const char* defaultValue) const;
// fixed size fields only
status_t SetData(const char* name, type_code type, const void* data,
int32 numBytes);
status_t SetData(const char* name, type_code type,
const void* data, int32 numBytes);
inline status_t SetBool(const char* name, bool value);
inline status_t SetInt8(const char* name, int8 value);
inline status_t SetInt16(const char* name, int16 value);
@@ -127,21 +151,32 @@ public:
port_id ReplyPort() const;
int32 ReplyToken() const;
void SetDeliveryInfo(int32 targetToken, port_id replyPort,
int32 replyToken, team_id senderTeam);
void SetDeliveryInfo(int32 targetToken,
port_id replyPort, int32 replyToken,
team_id senderTeam);
status_t SendTo(port_id targetPort, int32 targetToken = -1,
port_id replyPort = -1, int32 replyToken = -1, bigtime_t timeout = -1,
status_t SendTo(port_id targetPort,
int32 targetToken = -1,
port_id replyPort = -1,
int32 replyToken = -1,
bigtime_t timeout = -1,
team_id senderTeam = -1);
status_t SendTo(port_id targetPort, int32 targetToken,
KMessage* reply, bigtime_t deliveryTimeout = -1,
bigtime_t replyTimeout = -1, team_id senderTeam = -1);
status_t SendReply(KMessage* message, port_id replyPort = -1,
int32 replyToken = -1, bigtime_t timeout = -1, team_id senderTeam = -1);
status_t SendReply(KMessage* message, KMessage* reply,
bigtime_t deliveryTimeout = -1, bigtime_t replyTimeout = -1,
KMessage* reply,
bigtime_t deliveryTimeout = -1,
bigtime_t replyTimeout = -1,
team_id senderTeam = -1);
status_t ReceiveFrom(port_id fromPort, bigtime_t timeout = -1,
status_t SendReply(KMessage* message,
port_id replyPort = -1,
int32 replyToken = -1,
bigtime_t timeout = -1,
team_id senderTeam = -1);
status_t SendReply(KMessage* message, KMessage* reply,
bigtime_t deliveryTimeout = -1,
bigtime_t replyTimeout = -1,
team_id senderTeam = -1);
status_t ReceiveFrom(port_id fromPort,
bigtime_t timeout = -1,
port_message_info* messageInfo = NULL);
void Dump(void (*printFunc)(const char*, ...)) const;
@@ -164,31 +199,39 @@ private:
struct FieldHeader;
struct FieldValueHeader;
private:
Header* _Header() const;
int32 _BufferOffsetFor(const void* data) const;
FieldHeader* _FirstFieldHeader() const;
FieldHeader* _LastFieldHeader() const;
FieldHeader* _FieldHeaderForOffset(int32 offset) const;
status_t _AddField(const char *name, type_code type, int32 elementSize,
KMessageField *field);
status_t _AddFieldData(KMessageField *field, const void *data,
int32 elementSize, int32 elementCount);
status_t _AddField(const char* name, type_code type,
int32 elementSize, KMessageField* field);
status_t _AddFieldData(KMessageField* field,
const void* data, int32 elementSize,
int32 elementCount);
status_t _InitFromBuffer(bool sizeFromBuffer);
void _InitBuffer(uint32 what);
void _CheckBuffer(); // debugging only
status_t _AllocateSpace(int32 size, bool alignAddress, bool alignSize,
void **address, int32 *alignedSize);
status_t _AllocateSpace(int32 size, bool alignAddress,
bool alignSize, void** address,
int32* alignedSize);
int32 _CapacityFor(int32 size);
template<typename T> inline status_t _FindType(const char* name,
type_code type, int32 index, T *value) const;
template<typename T> inline T _GetType(const char* name, type_code type,
template<typename T>
inline status_t _FindType(const char* name, type_code type,
int32 index, T* value) const;
template<typename T>
inline T _GetType(const char* name, type_code type,
int32 index, const T& defaultValue) const;
Header fHeader; // pointed to by fBuffer, if nothing is
// allocated
private:
Header fHeader; // pointed to by fBuffer, if nothing
// is allocated
void* fBuffer;
int32 fBufferCapacity;
uint32 fFlags;
@@ -209,26 +252,32 @@ public:
const char* Name() const;
type_code TypeCode() const;
bool HasFixedElementSize() const;
int32 ElementSize() const; // if HasFixedElementSize()
int32 ElementSize() const;
// only if HasFixedElementSize()
status_t AddElement(const void* data, int32 size = -1);
status_t AddElements(const void *data, int32 count, int32 elementSize = -1);
const void *ElementAt(int32 index, int32 *size = NULL) const;
status_t AddElements(const void* data, int32 count,
int32 elementSize = -1);
const void* ElementAt(int32 index,
int32* size = NULL) const;
int32 CountElements() const;
private:
friend class KMessage;
private:
void SetTo(KMessage* message, int32 headerOffset);
KMessage::FieldHeader* _Header() const;
friend class KMessage;
private:
KMessage* fMessage;
int32 fHeaderOffset;
};
} // namespace BPrivate
using BPrivate::KMessage;
using BPrivate::KMessageField;
+95 -82
View File
@@ -1,8 +1,9 @@
/*
* Copyright 2005-2007, Ingo Weinhold, [email protected].
* All rights reserved. Distributed under the terms of the MIT License.
* Copyright 2005-2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#include <util/KMessage.h>
#include <stdlib.h>
@@ -13,17 +14,18 @@
#include <KernelExport.h>
#include <TypeConstants.h>
#if defined(_BOOT_MODE) || defined(_LOADER_MODE)
# include <util/kernel_cpp.h>
#else
# include <new>
#endif
using std::nothrow;
// TODO: Add a field index using a hash map, so that lookup improves to O(1)
// (is now O(n)).
// define the PANIC macro
#ifndef PANIC
# ifdef _KERNEL_MODE
@@ -33,28 +35,31 @@ using std::nothrow;
# endif
#endif
static const int32 kMessageReallocChunkSize = 64;
// kMessageHeaderMagic
const uint32 KMessage::kMessageHeaderMagic = 'kMsG';
// _Align
static inline
int32
// #pragma mark - Helper Functions
static inline int32
_Align(int32 offset)
{
return (offset + 3) & ~0x3;
}
// _Align
static inline
void*
static inline void*
_Align(void* address, int32 offset = 0)
{
return (void*)(((uint32)address + offset + 3) & ~0x3);
}
// FieldValueHeader
// #pragma mark - FieldValueHeader
struct KMessage::FieldValueHeader {
int32 size;
@@ -69,7 +74,10 @@ struct KMessage::FieldValueHeader {
}
};
// FieldHeader
// #pragma mark - FieldHeader
struct KMessage::FieldHeader {
type_code type;
int32 elementSize; // if < 0: non-fixed size
@@ -83,7 +91,10 @@ struct KMessage::FieldHeader {
return (uint8*)this + headerSize;
}
bool HasFixedElementSize() { return (elementSize >= 0); }
bool HasFixedElementSize()
{
return elementSize >= 0;
}
void* ElementAt(int32 index, int32* size)
{
@@ -108,9 +119,13 @@ struct KMessage::FieldHeader {
}
};
// constructor
// #pragma mark - KMessage
KMessage::KMessage()
: fBuffer(NULL),
:
fBuffer(NULL),
fBufferCapacity(0),
fFlags(0),
fLastFieldOffset(0)
@@ -118,9 +133,10 @@ KMessage::KMessage()
Unset();
}
// constructor
KMessage::KMessage(uint32 what)
: fBuffer(NULL),
:
fBuffer(NULL),
fBufferCapacity(0),
fFlags(0),
fLastFieldOffset(0)
@@ -129,13 +145,13 @@ KMessage::KMessage(uint32 what)
SetWhat(what);
}
// destructor
KMessage::~KMessage()
{
Unset();
}
// SetTo
status_t
KMessage::SetTo(uint32 what, uint32 flags)
{
@@ -145,7 +161,7 @@ KMessage::SetTo(uint32 what, uint32 flags)
return B_OK;
}
// SetTo
status_t
KMessage::SetTo(void* buffer, int32 bufferSize, uint32 what, uint32 flags)
{
@@ -180,7 +196,7 @@ KMessage::SetTo(void *buffer, int32 bufferSize, uint32 what, uint32 flags)
return error;
}
// SetTo
status_t
KMessage::SetTo(const void* buffer, int32 bufferSize)
{
@@ -188,7 +204,7 @@ KMessage::SetTo(const void *buffer, int32 bufferSize)
KMESSAGE_INIT_FROM_BUFFER | KMESSAGE_READ_ONLY);
}
// Unset
void
KMessage::Unset()
{
@@ -200,42 +216,42 @@ KMessage::Unset()
_InitBuffer(0);
}
// SetWhat
void
KMessage::SetWhat(uint32 what)
{
_Header()->what = what;
}
// What
uint32
KMessage::What() const
{
return _Header()->what;
}
// Buffer
const void*
KMessage::Buffer() const
{
return fBuffer;
}
// BufferCapacity
int32
KMessage::BufferCapacity() const
{
return fBufferCapacity;
}
// ContentSize
int32
KMessage::ContentSize() const
{
return _Header()->size;
}
// AddField
status_t
KMessage::AddField(const char* name, type_code type, int32 elementSize,
KMessageField* field)
@@ -248,14 +264,14 @@ KMessage::AddField(const char *name, type_code type, int32 elementSize,
return _AddField(name, type, elementSize, field);
}
// FindField
status_t
KMessage::FindField(const char* name, KMessageField* field) const
{
return FindField(name, B_ANY_TYPE, field);
}
// FindField
status_t
KMessage::FindField(const char* name, type_code type,
KMessageField* field) const
@@ -276,7 +292,7 @@ KMessage::FindField(const char *name, type_code type,
return B_NAME_NOT_FOUND;
}
// GetNextField
status_t
KMessage::GetNextField(KMessageField* field) const
{
@@ -309,7 +325,6 @@ KMessage::IsEmpty() const
}
// AddData
status_t
KMessage::AddData(const char* name, type_code type, const void* data,
int32 numBytes, bool isFixedSize)
@@ -331,7 +346,7 @@ KMessage::AddData(const char *name, type_code type, const void *data,
return _AddFieldData(&field, data, numBytes, 1);
}
// AddArray
status_t
KMessage::AddArray(const char* name, type_code type, const void* data,
int32 elementSize, int32 elementCount)
@@ -355,7 +370,6 @@ KMessage::AddArray(const char *name, type_code type, const void *data,
}
// SetData
status_t
KMessage::SetData(const char* name, type_code type, const void* data,
int32 numBytes)
@@ -390,7 +404,6 @@ KMessage::SetData(const char* name, type_code type, const void* data,
}
// FindData
status_t
KMessage::FindData(const char* name, type_code type, const void** data,
int32* numBytes) const
@@ -398,7 +411,7 @@ KMessage::FindData(const char *name, type_code type, const void **data,
return FindData(name, type, 0, data, numBytes);
}
// FindData
status_t
KMessage::FindData(const char* name, type_code type, int32 index,
const void** data, int32* numBytes) const
@@ -417,35 +430,35 @@ KMessage::FindData(const char *name, type_code type, int32 index,
return B_OK;
}
// Sender
team_id
KMessage::Sender() const
{
return _Header()->sender;
}
// TargetToken
int32
KMessage::TargetToken() const
{
return _Header()->targetToken;
}
// ReplyPort
port_id
KMessage::ReplyPort() const
{
return _Header()->replyPort;
}
// ReplyToken
int32
KMessage::ReplyToken() const
{
return _Header()->replyToken;
}
// SetDeliveryInfo
void
KMessage::SetDeliveryInfo(int32 targetToken, port_id replyPort,
int32 replyToken, team_id senderTeam)
@@ -458,9 +471,10 @@ KMessage::SetDeliveryInfo(int32 targetToken, port_id replyPort,
header->sender = senderTeam;
}
#ifndef KMESSAGE_CONTAINER_ONLY
// SendTo
status_t
KMessage::SendTo(port_id targetPort, int32 targetToken, port_id replyPort,
int32 replyToken, bigtime_t timeout, team_id senderTeam)
@@ -485,7 +499,7 @@ KMessage::SendTo(port_id targetPort, int32 targetToken, port_id replyPort,
B_RELATIVE_TIMEOUT, timeout);
}
// SendTo
status_t
KMessage::SendTo(port_id targetPort, int32 targetToken, KMessage* reply,
bigtime_t deliveryTimeout, bigtime_t replyTimeout, team_id senderTeam)
@@ -540,7 +554,7 @@ KMessage::SendTo(port_id targetPort, int32 targetToken, KMessage* reply,
return B_OK;
}
// SendReply
status_t
KMessage::SendReply(KMessage* message, port_id replyPort, int32 replyToken,
bigtime_t timeout, team_id senderTeam)
@@ -551,7 +565,7 @@ KMessage::SendReply(KMessage* message, port_id replyPort, int32 replyToken,
timeout, senderTeam);
}
// SendReply
status_t
KMessage::SendReply(KMessage* message, KMessage* reply,
bigtime_t deliveryTimeout, bigtime_t replyTimeout, team_id senderTeam)
@@ -563,7 +577,6 @@ KMessage::SendReply(KMessage* message, KMessage* reply,
}
// ReceiveFrom
status_t
KMessage::ReceiveFrom(port_id fromPort, bigtime_t timeout,
port_message_info* messageInfo)
@@ -606,6 +619,7 @@ KMessage::ReceiveFrom(port_id fromPort, bigtime_t timeout,
KMESSAGE_OWNS_BUFFER | KMESSAGE_INIT_FROM_BUFFER);
}
#endif // !KMESSAGE_CONTAINER_ONLY
@@ -671,37 +685,36 @@ KMessage::Dump(void (*printFunc)(const char*, ...)) const
}
// _Header
KMessage::Header*
KMessage::_Header() const
{
return (Header*)fBuffer;
}
// _BufferOffsetFor
int32
KMessage::_BufferOffsetFor(const void* data) const
{
if (!data)
return -1;
return ((uint8*)data - (uint8*)fBuffer);
return (uint8*)data - (uint8*)fBuffer;
}
// _FirstFieldHeader
KMessage::FieldHeader*
KMessage::_FirstFieldHeader() const
{
return (FieldHeader*)_Align(fBuffer, sizeof(Header));
}
// _LastFieldHeader
KMessage::FieldHeader*
KMessage::_LastFieldHeader() const
{
return _FieldHeaderForOffset(fLastFieldOffset);
}
// _FieldHeaderForOffset
KMessage::FieldHeader*
KMessage::_FieldHeaderForOffset(int32 offset) const
{
@@ -710,7 +723,7 @@ KMessage::_FieldHeaderForOffset(int32 offset) const
return (FieldHeader*)((uint8*)fBuffer + offset);
}
// _AddField
status_t
KMessage::_AddField(const char* name, type_code type, int32 elementSize,
KMessageField* field)
@@ -733,7 +746,7 @@ KMessage::_AddField(const char *name, type_code type, int32 elementSize,
return B_OK;
}
// _AddFieldData
status_t
KMessage::_AddFieldData(KMessageField* field, const void* data,
int32 elementSize, int32 elementCount)
@@ -788,7 +801,7 @@ KMessage::_AddFieldData(KMessageField *field, const void *data,
return B_OK;
}
// _InitFromBuffer
status_t
KMessage::_InitFromBuffer(bool sizeFromBuffer)
{
@@ -866,7 +879,7 @@ KMessage::_InitFromBuffer(bool sizeFromBuffer)
return B_OK;
}
// _InitBuffer
void
KMessage::_InitBuffer(uint32 what)
{
@@ -881,7 +894,7 @@ KMessage::_InitBuffer(uint32 what)
fLastFieldOffset = 0;
}
// _CheckBuffer
void
KMessage::_CheckBuffer()
{
@@ -894,7 +907,7 @@ KMessage::_CheckBuffer()
}
}
// _AllocateSpace
status_t
KMessage::_AllocateSpace(int32 size, bool alignAddress, bool alignSize,
void** address, int32* alignedSize)
@@ -937,7 +950,7 @@ KMessage::_AllocateSpace(int32 size, bool alignAddress, bool alignSize,
return B_OK;
}
// _CapacityFor
int32
KMessage::_CapacityFor(int32 size)
{
@@ -946,16 +959,17 @@ KMessage::_CapacityFor(int32 size)
}
// #pragma mark -
// #pragma mark - KMessageField
// constructor
KMessageField::KMessageField()
: fMessage(NULL),
:
fMessage(NULL),
fHeaderOffset(0)
{
}
// Unset
void
KMessageField::Unset()
{
@@ -963,46 +977,46 @@ KMessageField::Unset()
fHeaderOffset = 0;
}
// Message
KMessage*
KMessageField::Message() const
{
return fMessage;
}
// Name
const char*
KMessageField::Name() const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->name : NULL);
return header ? header->name : NULL;
}
// TypeCode
type_code
KMessageField::TypeCode() const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->type : 0);
return header ? header->type : 0;
}
// HasFixedElementSize
bool
KMessageField::HasFixedElementSize() const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->HasFixedElementSize() : false);
return header ? header->HasFixedElementSize() : false;
}
// ElementSize
int32
KMessageField::ElementSize() const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->elementSize : -1);
return header ? header->elementSize : -1;
}
// AddElement
status_t
KMessageField::AddElement(const void* data, int32 size)
{
@@ -1017,7 +1031,7 @@ KMessageField::AddElement(const void *data, int32 size)
return fMessage->_AddFieldData(this, data, size, 1);
}
// AddElements
status_t
KMessageField::AddElements(const void* data, int32 count, int32 elementSize)
{
@@ -1032,23 +1046,23 @@ KMessageField::AddElements(const void *data, int32 count, int32 elementSize)
return fMessage->_AddFieldData(this, data, elementSize, count);
}
// ElementAt
const void*
KMessageField::ElementAt(int32 index, int32* size) const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->ElementAt(index, size) : NULL);
return header ? header->ElementAt(index, size) : NULL;
}
// CountElements
int32
KMessageField::CountElements() const
{
KMessage::FieldHeader* header = _Header();
return (header ? header->elementCount : 0);
return header ? header->elementCount : 0;
}
// SetTo
void
KMessageField::SetTo(KMessage* message, int32 headerOffset)
{
@@ -1056,10 +1070,9 @@ KMessageField::SetTo(KMessage *message, int32 headerOffset)
fHeaderOffset = headerOffset;
}
// _GetHeader
KMessage::FieldHeader*
KMessageField::_Header() const
{
return (fMessage ? fMessage->_FieldHeaderForOffset(fHeaderOffset) : NULL);
return fMessage ? fMessage->_FieldHeaderForOffset(fHeaderOffset) : NULL;
}