Skip to content

Commit 75eaa18

Browse files
committed
Just move IAttributeSource virtual methods near top
1 parent aa144a0 commit 75eaa18

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

source/Attributes.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,22 @@ struct AttributeValue
222222
struct IAttributeSource
223223
{
224224
public:
225+
// Client implemented. The other two GetString functions are conveniences that just
226+
// forward to this implementation.
227+
virtual HRESULT GetString(uint32_t id, _Out_ array_ref<char16_t>& value) = 0;
228+
229+
// Client implemented. Callers generally use the more convenient helper methods,
230+
// since the actual implementation just returns raw byte data.
231+
virtual HRESULT GetValueData(uint32_t id, _Out_ Attribute::Type& type, _Out_ array_ref<uint8_t>& value) = 0;
232+
233+
// Retrieve the last update for this attribute, enabling a caller to
234+
// cache results for expensive operations. It's okay to update the
235+
// cookie value even if the same value was set for an attribute (it just
236+
// means the client will lose caching), but the cookieValue must be
237+
// updated each time that attribute is changed (incrementing is
238+
// simple enough).
239+
virtual HRESULT GetCookie(uint32_t id, _Out_ uint32_t& cookieValue) = 0;
240+
225241
////////////////////////////////////////
226242
// String form getters.
227243
// - The string is both length delimited and nul-terminated.
@@ -236,10 +252,6 @@ struct IAttributeSource
236252
// Return copy of the string rather than view.
237253
HRESULT GetString(uint32_t id, _Out_ std::u16string& s);
238254

239-
// Client implemented. The other two forms are conveniences that just
240-
// forward to this implementation.
241-
virtual HRESULT GetString(uint32_t id, _Out_ array_ref<char16_t>& value) = 0;
242-
243255
////////////////////////////////////////
244256
// Value getters.
245257
// - Any data value pointers returned must stay valid for the lifetime of
@@ -341,10 +353,6 @@ struct IAttributeSource
341353
return values;
342354
}
343355

344-
// Client implemented. Callers generally use the more convenient ones above,
345-
// since the actual implementation just returns raw byte data.
346-
virtual HRESULT GetValueData(uint32_t id, _Out_ Attribute::Type& type, _Out_ array_ref<uint8_t>& value) = 0;
347-
348356
////////////////////////////////////////
349357
// Cookie functions for value modification awareness.
350358

@@ -360,12 +368,4 @@ struct IAttributeSource
360368
previousCookieValue = cookieValue;
361369
return false;
362370
}
363-
364-
// Retrieve the last update for this attribute, enabling a caller to
365-
// cache results for expensive operations. It's okay to update the
366-
// cookie value even if the same value was set for an attribute (it just
367-
// means the client will lose caching), but the cookieValue must be
368-
// updated each time that attribute is changed (incrementing is
369-
// simple enough).
370-
virtual HRESULT GetCookie(uint32_t id, _Out_ uint32_t& cookieValue) = 0;
371371
};

0 commit comments

Comments
 (0)