rippled
SField.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_PROTOCOL_SFIELD_H_INCLUDED
21 #define RIPPLE_PROTOCOL_SFIELD_H_INCLUDED
22 
23 #include <ripple/basics/safe_cast.h>
24 #include <ripple/json/json_value.h>
25 #include <cstdint>
26 #include <map>
27 #include <utility>
28 
29 namespace ripple {
30 
31 /*
32 
33 Some fields have a different meaning for their
34  default value versus not present.
35  Example:
36  QualityIn on a TrustLine
37 
38 */
39 
40 //------------------------------------------------------------------------------
41 
42 // Forwards
43 class STAccount;
44 class STAmount;
45 class STBlob;
46 template <std::size_t>
48 template <class>
49 class STInteger;
50 class STVector256;
51 
53 {
54  // special types
56  STI_DONE = -1,
58 
59  // // types (common)
66  STI_VL = 7,
68  // 9-13 are reserved
69  STI_OBJECT = 14,
70  STI_ARRAY = 15,
71 
72  // types (uncommon)
73  STI_UINT8 = 16,
77 
78  // high level types
79  // cannot be serialized inside other types
80  STI_TRANSACTION = 10001,
81  STI_LEDGERENTRY = 10002,
82  STI_VALIDATION = 10003,
83  STI_METADATA = 10004,
84 };
85 
86 // constexpr
87 inline
88 int
90 {
91  return (safe_cast<int>(id) << 16) | index;
92 }
93 
94 // constexpr
95 inline
96 int
97 field_code(int id, int index)
98 {
99  return (id << 16) | index;
100 }
101 
112 class SField
113 {
114 public:
115  enum
116  {
117  sMD_Never = 0x00,
118  sMD_ChangeOrig = 0x01, // original value when it changes
119  sMD_ChangeNew = 0x02, // new value when it changes
120  sMD_DeleteFinal = 0x04, // final value when it is deleted
121  sMD_Create = 0x08, // value when it's created
122  sMD_Always = 0x10, // value when node containing it is affected at all
124  };
125 
126  enum class IsSigning : unsigned char
127  {
128  no,
129  yes
130  };
132 
133  int const fieldCode; // (type<<16)|index
134  SerializedTypeID const fieldType; // STI_*
135  int const fieldValue; // Code number for protocol
137  int const fieldMeta;
138  int const fieldNum;
141 
142  SField(SField const&) = delete;
143  SField& operator=(SField const&) = delete;
144  SField(SField&&) = delete;
145  SField& operator=(SField&&) = delete;
146 
147 public:
148  struct private_access_tag_t; // public, but still an implementation detail
149 
150  // These constructors can only be called from SField.cpp
152  const char* fn, int meta = sMD_Default,
153  IsSigning signing = IsSigning::yes);
154  explicit SField (private_access_tag_t, int fc);
155 
156  static const SField& getField (int fieldCode);
157  static const SField& getField (std::string const& fieldName);
158  static const SField& getField (int type, int value)
159  {
160  return getField (field_code (type, value));
161  }
162 
163  static const SField& getField (SerializedTypeID type, int value)
164  {
165  return getField (field_code (type, value));
166  }
167 
168  std::string const& getName () const
169  {
170  return fieldName;
171  }
172 
173  bool hasName () const
174  {
175  return fieldCode > 0;
176  }
177 
179  {
180  return jsonName;
181  }
182 
183  bool isGeneric () const
184  {
185  return fieldCode == 0;
186  }
187  bool isInvalid () const
188  {
189  return fieldCode == -1;
190  }
191  bool isUseful () const
192  {
193  return fieldCode > 0;
194  }
195  bool isKnown () const
196  {
197  return fieldType != STI_UNKNOWN;
198  }
199  bool isBinary () const
200  {
201  return fieldValue < 256;
202  }
203 
204  // A discardable field is one that cannot be serialized, and
205  // should be discarded during serialization,like 'hash'.
206  // You cannot serialize an object's hash inside that object,
207  // but you can have it in the JSON representation.
208  bool isDiscardable () const
209  {
210  return fieldValue > 256;
211  }
212 
213  int getCode () const
214  {
215  return fieldCode;
216  }
217  int getNum () const
218  {
219  return fieldNum;
220  }
221  static int getNumFields ()
222  {
223  return num;
224  }
225 
226  bool isSigningField () const
227  {
228  return signingField == IsSigning::yes;
229  }
230  bool shouldMeta (int c) const
231  {
232  return (fieldMeta & c) != 0;
233  }
234 
235  bool shouldInclude (bool withSigningField) const
236  {
237  return (fieldValue < 256) &&
238  (withSigningField || (signingField == IsSigning::yes));
239  }
240 
241  bool operator== (const SField& f) const
242  {
243  return fieldCode == f.fieldCode;
244  }
245 
246  bool operator!= (const SField& f) const
247  {
248  return fieldCode != f.fieldCode;
249  }
250 
251  static int compare (const SField& f1, const SField& f2);
252 
253 private:
254  static int num;
256 };
257 
259 template <class T>
261 {
262  using type = T;
263 
264  template <class... Args>
265  explicit
266  TypedField (Args&&... args)
267  : SField(std::forward<Args>(args)...)
268  {
269  }
270 
272  : SField(std::move(u))
273  {
274  }
275 };
276 
278 template <class T>
280 {
281  TypedField<T> const* f;
282 
283  explicit
285  : f (&f_)
286  {
287  }
288 };
289 
290 template <class T>
291 inline
292 OptionaledField<T>
294 {
295  return OptionaledField<T>(f);
296 }
297 
298 //------------------------------------------------------------------------------
299 
300 //------------------------------------------------------------------------------
301 
313 
314 //------------------------------------------------------------------------------
315 
316 extern SField const sfInvalid;
317 extern SField const sfGeneric;
318 extern SField const sfLedgerEntry;
319 extern SField const sfTransaction;
320 extern SField const sfValidation;
321 extern SField const sfMetadata;
322 
323 // 8-bit integers
325 extern SF_U8 const sfMethod;
327 extern SF_U8 const sfTickSize;
328 
329 // 16-bit integers
332 extern SF_U16 const sfSignerWeight;
333 
334 // 16-bit integers (uncommon)
335 extern SF_U16 const sfVersion;
336 
337 // 32-bit integers (common)
338 extern SF_U32 const sfFlags;
339 extern SF_U32 const sfSourceTag;
340 extern SF_U32 const sfSequence;
343 extern SF_U32 const sfCloseTime;
345 extern SF_U32 const sfSigningTime;
346 extern SF_U32 const sfExpiration;
347 extern SF_U32 const sfTransferRate;
348 extern SF_U32 const sfWalletSize;
349 extern SF_U32 const sfOwnerCount;
351 
352 // 32-bit integers (uncommon)
353 extern SF_U32 const sfHighQualityIn;
355 extern SF_U32 const sfLowQualityIn;
356 extern SF_U32 const sfLowQualityOut;
357 extern SF_U32 const sfQualityIn;
358 extern SF_U32 const sfQualityOut;
359 extern SF_U32 const sfStampEscrow;
360 extern SF_U32 const sfBondAmount;
361 extern SF_U32 const sfLoadFee;
362 extern SF_U32 const sfOfferSequence;
363 extern SF_U32 const sfFirstLedgerSequence; // Deprecated: do not use
368 extern SF_U32 const sfReserveBase;
370 extern SF_U32 const sfSetFlag;
371 extern SF_U32 const sfClearFlag;
372 extern SF_U32 const sfSignerQuorum;
373 extern SF_U32 const sfCancelAfter;
374 extern SF_U32 const sfFinishAfter;
375 extern SF_U32 const sfSignerListID;
376 extern SF_U32 const sfSettleDelay;
377 
378 // 64-bit integers
379 extern SF_U64 const sfIndexNext;
380 extern SF_U64 const sfIndexPrevious;
381 extern SF_U64 const sfBookNode;
382 extern SF_U64 const sfOwnerNode;
383 extern SF_U64 const sfBaseFee;
384 extern SF_U64 const sfExchangeRate;
385 extern SF_U64 const sfLowNode;
386 extern SF_U64 const sfHighNode;
388 extern SF_U64 const sfCookie;
389 
390 
391 // 128-bit
392 extern SF_U128 const sfEmailHash;
393 
394 // 160-bit (common)
399 
400 // 256-bit (common)
401 extern SF_U256 const sfLedgerHash;
402 extern SF_U256 const sfParentHash;
404 extern SF_U256 const sfAccountHash;
406 extern SF_U256 const sfLedgerIndex;
408 extern SF_U256 const sfRootIndex;
409 extern SF_U256 const sfAccountTxnID;
410 
411 // 256-bit (uncommon)
413 extern SF_U256 const sfInvoiceID;
414 extern SF_U256 const sfNickname;
415 extern SF_U256 const sfAmendment;
416 extern SF_U256 const sfTicketID;
417 extern SF_U256 const sfDigest;
418 extern SF_U256 const sfPayChannel;
420 extern SF_U256 const sfCheckID;
421 
422 // currency amount (common)
423 extern SF_Amount const sfAmount;
424 extern SF_Amount const sfBalance;
426 extern SF_Amount const sfTakerPays;
427 extern SF_Amount const sfTakerGets;
428 extern SF_Amount const sfLowLimit;
429 extern SF_Amount const sfHighLimit;
430 extern SF_Amount const sfFee;
431 extern SF_Amount const sfSendMax;
432 extern SF_Amount const sfDeliverMin;
433 
434 // currency amount (uncommon)
438 
439 // variable length (common)
440 extern SF_Blob const sfPublicKey;
441 extern SF_Blob const sfMessageKey;
443 extern SF_Blob const sfTxnSignature;
444 extern SF_Blob const sfSignature;
445 extern SF_Blob const sfDomain;
446 extern SF_Blob const sfFundCode;
447 extern SF_Blob const sfRemoveCode;
448 extern SF_Blob const sfExpireCode;
449 extern SF_Blob const sfCreateCode;
450 extern SF_Blob const sfMemoType;
451 extern SF_Blob const sfMemoData;
452 extern SF_Blob const sfMemoFormat;
453 
454 // variable length (uncommon)
455 extern SF_Blob const sfFulfillment;
456 extern SF_Blob const sfCondition;
458 
459 // account
460 extern SF_Account const sfAccount;
461 extern SF_Account const sfOwner;
463 extern SF_Account const sfIssuer;
464 extern SF_Account const sfAuthorize;
466 extern SF_Account const sfTarget;
468 
469 // path set
470 extern SField const sfPaths;
471 
472 // vector of 256-bit
473 extern SF_Vec256 const sfIndexes;
474 extern SF_Vec256 const sfHashes;
475 extern SF_Vec256 const sfAmendments;
476 
477 // inner object
478 // OBJECT/1 is reserved for end of object
480 extern SField const sfCreatedNode;
481 extern SField const sfDeletedNode;
482 extern SField const sfModifiedNode;
484 extern SField const sfFinalFields;
485 extern SField const sfNewFields;
486 extern SField const sfTemplateEntry;
487 extern SField const sfMemo;
488 extern SField const sfSignerEntry;
489 extern SField const sfSigner;
490 extern SField const sfMajority;
491 
492 // array of objects
493 // ARRAY/1 is reserved for end of array
494 // extern SField const sfSigningAccounts; // Never been used.
495 extern SField const sfSigners;
496 extern SField const sfSignerEntries;
497 extern SField const sfTemplate;
498 extern SField const sfNecessary;
499 extern SField const sfSufficient;
500 extern SField const sfAffectedNodes;
501 extern SField const sfMemos;
502 extern SField const sfMajorities;
503 
504 //------------------------------------------------------------------------------
505 
506 } // ripple
507 
508 #endif
ripple::sfHighQualityIn
const SF_U32 sfHighQualityIn(access, STI_UINT32, 16, "HighQualityIn")
Definition: SField.h:353
ripple::TypedField::TypedField
TypedField(TypedField &&u)
Definition: SField.h:271
ripple::sfRegularKey
const SF_Account sfRegularKey(access, STI_ACCOUNT, 8, "RegularKey")
Definition: SField.h:467
ripple::sfLoadFee
const SF_U32 sfLoadFee(access, STI_UINT32, 24, "LoadFee")
Definition: SField.h:361
ripple::sfIndexNext
const SF_U64 sfIndexNext(access, STI_UINT64, 1, "IndexNext")
Definition: SField.h:379
ripple::sfPreviousFields
const SField sfPreviousFields(access, STI_OBJECT, 6, "PreviousFields")
Definition: SField.h:483
ripple::sfTarget
const SF_Account sfTarget(access, STI_ACCOUNT, 7, "Target")
Definition: SField.h:466
ripple::sfTicketID
const SF_U256 sfTicketID(access, STI_HASH256, 20, "TicketID")
Definition: SField.h:416
ripple::SField::IsSigning
IsSigning
Definition: SField.h:126
ripple::sfTransactionIndex
const SF_U32 sfTransactionIndex(access, STI_UINT32, 28, "TransactionIndex")
Definition: SField.h:365
std::string
STL class.
ripple::SField::getField
static const SField & getField(SerializedTypeID type, int value)
Definition: SField.h:163
utility
ripple::TypedField
A field with a type known at compile time.
Definition: SField.h:260
ripple::sfTemplateEntry
const SField sfTemplateEntry(access, STI_OBJECT, 9, "TemplateEntry")
Definition: SField.h:486
ripple::STI_METADATA
@ STI_METADATA
Definition: SField.h:83
ripple::sfPreviousTxnLgrSeq
const SF_U32 sfPreviousTxnLgrSeq(access, STI_UINT32, 5, "PreviousTxnLgrSeq", SField::sMD_DeleteFinal)
Definition: SField.h:341
ripple::sfGeneric
const SField sfGeneric(access, 0)
Definition: SField.h:317
ripple::sfParentCloseTime
const SF_U32 sfParentCloseTime(access, STI_UINT32, 8, "ParentCloseTime")
Definition: SField.h:344
ripple::SField::fieldValue
const int fieldValue
Definition: SField.h:135
ripple::sfQualityIn
const SF_U32 sfQualityIn(access, STI_UINT32, 20, "QualityIn")
Definition: SField.h:357
ripple::sfLedgerIndex
const SF_U256 sfLedgerIndex(access, STI_HASH256, 6, "LedgerIndex")
Definition: SField.h:406
ripple::sfLedgerEntryType
const SF_U16 sfLedgerEntryType(access, STI_UINT16, 1, "LedgerEntryType", SField::sMD_Never)
Definition: SField.h:330
ripple::sfSigners
const SField sfSigners(access, STI_ARRAY, 3, "Signers", SField::sMD_Default, SField::notSigning)
Definition: SField.h:495
ripple::SField::isBinary
bool isBinary() const
Definition: SField.h:199
ripple::SField::isInvalid
bool isInvalid() const
Definition: SField.h:187
ripple::sfMemoType
const SF_Blob sfMemoType(access, STI_VL, 12, "MemoType")
Definition: SField.h:450
ripple::sfOperationLimit
const SF_U32 sfOperationLimit(access, STI_UINT32, 29, "OperationLimit")
Definition: SField.h:366
ripple::sfSigningPubKey
const SF_Blob sfSigningPubKey(access, STI_VL, 3, "SigningPubKey")
Definition: SField.h:442
ripple::sfMetadata
const SField sfMetadata(access, STI_METADATA, 257, "Metadata")
Definition: SField.h:321
ripple::SField::private_access_tag_t
Definition: SField.cpp:33
ripple::sfDeliveredAmount
const SF_Amount sfDeliveredAmount(access, STI_AMOUNT, 18, "DeliveredAmount")
Definition: SField.h:437
ripple::sfSignerQuorum
const SF_U32 sfSignerQuorum(access, STI_UINT32, 35, "SignerQuorum")
Definition: SField.h:372
ripple::STI_AMOUNT
@ STI_AMOUNT
Definition: SField.h:65
ripple::sfMessageKey
const SF_Blob sfMessageKey(access, STI_VL, 2, "MessageKey")
Definition: SField.h:441
ripple::sfSequence
const SF_U32 sfSequence(access, STI_UINT32, 4, "Sequence")
Definition: SField.h:340
ripple::STI_UINT8
@ STI_UINT8
Definition: SField.h:73
ripple::field_code
int field_code(SerializedTypeID id, int index)
Definition: SField.h:89
ripple::SField::fieldName
const std::string fieldName
Definition: SField.h:136
ripple::sfSufficient
const SField sfSufficient(access, STI_ARRAY, 7, "Sufficient")
Definition: SField.h:499
ripple::STI_PATHSET
@ STI_PATHSET
Definition: SField.h:75
ripple::SField::hasName
bool hasName() const
Definition: SField.h:173
ripple::SerializedTypeID
SerializedTypeID
Definition: SField.h:52
ripple::SField::isUseful
bool isUseful() const
Definition: SField.h:191
ripple::sfAccount
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
Definition: SField.h:460
ripple::sfFlags
const SF_U32 sfFlags(access, STI_UINT32, 2, "Flags")
Definition: SField.h:338
ripple::STI_VALIDATION
@ STI_VALIDATION
Definition: SField.h:82
ripple::STI_LEDGERENTRY
@ STI_LEDGERENTRY
Definition: SField.h:81
ripple::SField::signingField
const IsSigning signingField
Definition: SField.h:139
ripple::sfTakerPaysIssuer
const SF_U160 sfTakerPaysIssuer(access, STI_HASH160, 2, "TakerPaysIssuer")
Definition: SField.h:396
ripple::sfNewFields
const SField sfNewFields(access, STI_OBJECT, 8, "NewFields")
Definition: SField.h:485
ripple::sfMasterSignature
const SF_Blob sfMasterSignature(access, STI_VL, 18, "MasterSignature", SField::sMD_Default, SField::notSigning)
Definition: SField.h:457
ripple::sfMajorities
const SField sfMajorities(access, STI_ARRAY, 16, "Majorities")
Definition: SField.h:502
ripple::SField::sMD_ChangeNew
@ sMD_ChangeNew
Definition: SField.h:119
ripple::sfWalletLocator
const SF_U256 sfWalletLocator(access, STI_HASH256, 7, "WalletLocator")
Definition: SField.h:407
ripple::SField::getField
static const SField & getField(int type, int value)
Definition: SField.h:158
ripple::sfTakerPays
const SF_Amount sfTakerPays(access, STI_AMOUNT, 4, "TakerPays")
Definition: SField.h:426
ripple::sfMethod
const SF_U8 sfMethod(access, STI_UINT8, 2, "Method")
Definition: SField.h:325
ripple::sfIssuer
const SF_Account sfIssuer(access, STI_ACCOUNT, 4, "Issuer")
Definition: SField.h:463
ripple::SField::operator!=
bool operator!=(const SField &f) const
Definition: SField.h:246
ripple::STI_DONE
@ STI_DONE
Definition: SField.h:56
ripple::SField::getNum
int getNum() const
Definition: SField.h:217
ripple::OptionaledField
Indicate boost::optional field semantics.
Definition: SField.h:279
ripple::sfUnauthorize
const SF_Account sfUnauthorize(access, STI_ACCOUNT, 6, "Unauthorize")
Definition: SField.h:465
ripple::SField::getField
static const SField & getField(int fieldCode)
Definition: SField.cpp:269
ripple::STI_ACCOUNT
@ STI_ACCOUNT
Definition: SField.h:67
ripple::STI_ARRAY
@ STI_ARRAY
Definition: SField.h:70
ripple::SField::knownCodeToField
static std::map< int, SField const * > knownCodeToField
Definition: SField.h:255
ripple::STI_HASH160
@ STI_HASH160
Definition: SField.h:74
ripple::sfOwnerNode
const SF_U64 sfOwnerNode(access, STI_UINT64, 4, "OwnerNode")
Definition: SField.h:382
ripple::sfSigner
const SField sfSigner(access, STI_OBJECT, 16, "Signer")
Definition: SField.h:489
ripple::sfTakerGetsCurrency
const SF_U160 sfTakerGetsCurrency(access, STI_HASH160, 3, "TakerGetsCurrency")
Definition: SField.h:397
ripple::sfPayChannel
const SF_U256 sfPayChannel(access, STI_HASH256, 22, "Channel")
Definition: SField.h:418
ripple::sfAmount
const SF_Amount sfAmount(access, STI_AMOUNT, 1, "Amount")
Definition: SField.h:423
ripple::SField::getJsonName
Json::StaticString const & getJsonName() const
Definition: SField.h:178
ripple::sfSignerEntries
const SField sfSignerEntries(access, STI_ARRAY, 4, "SignerEntries")
Definition: SField.h:496
ripple::SField::operator==
bool operator==(const SField &f) const
Definition: SField.h:241
ripple::sfOwnerCount
const SF_U32 sfOwnerCount(access, STI_UINT32, 13, "OwnerCount")
Definition: SField.h:349
ripple::STBitString
Definition: SField.h:47
ripple::SField::sMD_Never
@ sMD_Never
Definition: SField.h:117
ripple::sfFinalFields
const SField sfFinalFields(access, STI_OBJECT, 7, "FinalFields")
Definition: SField.h:484
ripple::SField::operator=
SField & operator=(SField const &)=delete
ripple::sfModifiedNode
const SField sfModifiedNode(access, STI_OBJECT, 5, "ModifiedNode")
Definition: SField.h:482
ripple::SField::jsonName
const Json::StaticString jsonName
Definition: SField.h:140
ripple::sfReserveBase
const SF_U32 sfReserveBase(access, STI_UINT32, 31, "ReserveBase")
Definition: SField.h:368
ripple::sfLimitAmount
const SF_Amount sfLimitAmount(access, STI_AMOUNT, 3, "LimitAmount")
Definition: SField.h:425
ripple::sfHighLimit
const SF_Amount sfHighLimit(access, STI_AMOUNT, 7, "HighLimit")
Definition: SField.h:429
ripple::sfFundCode
const SF_Blob sfFundCode(access, STI_VL, 8, "FundCode")
Definition: SField.h:446
ripple::sfFinishAfter
const SF_U32 sfFinishAfter(access, STI_UINT32, 37, "FinishAfter")
Definition: SField.h:374
ripple::sfInvalid
const SField sfInvalid(access, -1)
Definition: SField.h:316
ripple::sfSignature
const SF_Blob sfSignature(access, STI_VL, 6, "Signature", SField::sMD_Default, SField::notSigning)
Definition: SField.h:444
ripple::TypedField::TypedField
TypedField(Args &&... args)
Definition: SField.h:266
ripple::sfAccountTxnID
const SF_U256 sfAccountTxnID(access, STI_HASH256, 9, "AccountTxnID")
Definition: SField.h:409
ripple::sfLedgerEntry
const SField sfLedgerEntry(access, STI_LEDGERENTRY, 257, "LedgerEntry")
Definition: SField.h:318
ripple::sfLowLimit
const SF_Amount sfLowLimit(access, STI_AMOUNT, 6, "LowLimit")
Definition: SField.h:428
ripple::sfMajority
const SField sfMajority(access, STI_OBJECT, 18, "Majority")
Definition: SField.h:490
ripple::sfDestinationTag
const SF_U32 sfDestinationTag(access, STI_UINT32, 14, "DestinationTag")
Definition: SField.h:350
ripple::sfMemoData
const SF_Blob sfMemoData(access, STI_VL, 13, "MemoData")
Definition: SField.h:451
ripple::sfIndexPrevious
const SF_U64 sfIndexPrevious(access, STI_UINT64, 2, "IndexPrevious")
Definition: SField.h:380
ripple::SField::fieldType
const SerializedTypeID fieldType
Definition: SField.h:134
ripple::sfFulfillment
const SF_Blob sfFulfillment(access, STI_VL, 16, "Fulfillment")
Definition: SField.h:455
ripple::sfMinimumOffer
const SF_Amount sfMinimumOffer(access, STI_AMOUNT, 16, "MinimumOffer")
Definition: SField.h:435
ripple::SField::SField
SField(SField const &)=delete
ripple::sfLastLedgerSequence
const SF_U32 sfLastLedgerSequence(access, STI_UINT32, 27, "LastLedgerSequence")
Definition: SField.h:364
ripple::OptionaledField::OptionaledField
OptionaledField(TypedField< T > const &f_)
Definition: SField.h:284
ripple::sfOwner
const SF_Account sfOwner(access, STI_ACCOUNT, 2, "Owner")
Definition: SField.h:461
ripple::sfHighNode
const SF_U64 sfHighNode(access, STI_UINT64, 8, "HighNode")
Definition: SField.h:386
ripple::sfParentHash
const SF_U256 sfParentHash(access, STI_HASH256, 2, "ParentHash")
Definition: SField.h:402
ripple::sfBookDirectory
const SF_U256 sfBookDirectory(access, STI_HASH256, 16, "BookDirectory")
Definition: SField.h:412
ripple::SField::sMD_Always
@ sMD_Always
Definition: SField.h:122
ripple::SField::sMD_Create
@ sMD_Create
Definition: SField.h:121
ripple::sfRemoveCode
const SF_Blob sfRemoveCode(access, STI_VL, 9, "RemoveCode")
Definition: SField.h:447
ripple::sfSendMax
const SF_Amount sfSendMax(access, STI_AMOUNT, 9, "SendMax")
Definition: SField.h:431
ripple::sfAmendment
const SF_U256 sfAmendment(access, STI_HASH256, 19, "Amendment")
Definition: SField.h:415
ripple::sfSignerListID
const SF_U32 sfSignerListID(access, STI_UINT32, 38, "SignerListID")
Definition: SField.h:375
ripple::sfSigningTime
const SF_U32 sfSigningTime(access, STI_UINT32, 9, "SigningTime")
Definition: SField.h:345
ripple::sfDestinationNode
const SF_U64 sfDestinationNode(access, STI_UINT64, 9, "DestinationNode")
Definition: SField.h:387
ripple::SField::notSigning
static const IsSigning notSigning
Definition: SField.h:131
ripple::sfTransaction
const SField sfTransaction(access, STI_TRANSACTION, 257, "Transaction")
Definition: SField.h:319
ripple::STI_UNKNOWN
@ STI_UNKNOWN
Definition: SField.h:55
ripple::STI_VL
@ STI_VL
Definition: SField.h:66
ripple::STI_UINT16
@ STI_UINT16
Definition: SField.h:60
ripple::sfTxnSignature
const SF_Blob sfTxnSignature(access, STI_VL, 4, "TxnSignature", SField::sMD_Default, SField::notSigning)
Definition: SField.h:443
ripple::sfTransactionType
const SF_U16 sfTransactionType(access, STI_UINT16, 2, "TransactionType")
Definition: SField.h:331
ripple::STI_HASH256
@ STI_HASH256
Definition: SField.h:64
ripple::sfLedgerSequence
const SF_U32 sfLedgerSequence(access, STI_UINT32, 6, "LedgerSequence")
Definition: SField.h:342
ripple::sfReferenceFeeUnits
const SF_U32 sfReferenceFeeUnits(access, STI_UINT32, 30, "ReferenceFeeUnits")
Definition: SField.h:367
ripple::SField::sMD_DeleteFinal
@ sMD_DeleteFinal
Definition: SField.h:120
ripple::sfTransactionMetaData
const SField sfTransactionMetaData(access, STI_OBJECT, 2, "TransactionMetaData")
Definition: SField.h:479
ripple::sfExchangeRate
const SF_U64 sfExchangeRate(access, STI_UINT64, 6, "ExchangeRate")
Definition: SField.h:384
cstdint
ripple::sfCreateCode
const SF_Blob sfCreateCode(access, STI_VL, 11, "CreateCode")
Definition: SField.h:449
ripple::sfSignerEntry
const SField sfSignerEntry(access, STI_OBJECT, 11, "SignerEntry")
Definition: SField.h:488
ripple::SField::fieldCode
const int fieldCode
Definition: SField.h:133
ripple::SField::isKnown
bool isKnown() const
Definition: SField.h:195
ripple::sfLowQualityOut
const SF_U32 sfLowQualityOut(access, STI_UINT32, 19, "LowQualityOut")
Definition: SField.h:356
ripple::STI_VECTOR256
@ STI_VECTOR256
Definition: SField.h:76
ripple::sfValidation
const SField sfValidation(access, STI_VALIDATION, 257, "Validation")
Definition: SField.h:320
ripple::sfCreatedNode
const SField sfCreatedNode(access, STI_OBJECT, 3, "CreatedNode")
Definition: SField.h:480
map
ripple::sfSourceTag
const SF_U32 sfSourceTag(access, STI_UINT32, 3, "SourceTag")
Definition: SField.h:339
ripple::SField::getNumFields
static int getNumFields()
Definition: SField.h:221
ripple::sfIndexes
const SF_Vec256 sfIndexes(access, STI_VECTOR256, 1, "Indexes", SField::sMD_Never)
Definition: SField.h:473
ripple::sfExpiration
const SF_U32 sfExpiration(access, STI_UINT32, 10, "Expiration")
Definition: SField.h:346
ripple::sfFirstLedgerSequence
const SF_U32 sfFirstLedgerSequence(access, STI_UINT32, 26, "FirstLedgerSequence")
Definition: SField.h:363
ripple::sfFee
const SF_Amount sfFee(access, STI_AMOUNT, 8, "Fee")
Definition: SField.h:430
ripple::STInteger
Definition: SField.h:49
ripple::sfQualityOut
const SF_U32 sfQualityOut(access, STI_UINT32, 21, "QualityOut")
Definition: SField.h:358
ripple::sfVersion
const SF_U16 sfVersion(access, STI_UINT16, 16, "Version")
Definition: SField.h:335
ripple::SField::IsSigning::yes
@ yes
ripple::SField::shouldInclude
bool shouldInclude(bool withSigningField) const
Definition: SField.h:235
ripple::TypedField::type
T type
Definition: SField.h:262
ripple::SField::sMD_ChangeOrig
@ sMD_ChangeOrig
Definition: SField.h:118
ripple::sfMemo
const SField sfMemo(access, STI_OBJECT, 10, "Memo")
Definition: SField.h:487
ripple::sfHashes
const SF_Vec256 sfHashes(access, STI_VECTOR256, 2, "Hashes")
Definition: SField.h:474
ripple::STI_UINT32
@ STI_UINT32
Definition: SField.h:61
ripple::sfPublicKey
const SF_Blob sfPublicKey(access, STI_VL, 1, "PublicKey")
Definition: SField.h:440
ripple::sfSignerWeight
const SF_U16 sfSignerWeight(access, STI_UINT16, 3, "SignerWeight")
Definition: SField.h:332
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::sfWalletSize
const SF_U32 sfWalletSize(access, STI_UINT32, 12, "WalletSize")
Definition: SField.h:348
ripple::sfNecessary
const SField sfNecessary(access, STI_ARRAY, 6, "Necessary")
Definition: SField.h:498
ripple::sfLowQualityIn
const SF_U32 sfLowQualityIn(access, STI_UINT32, 18, "LowQualityIn")
Definition: SField.h:355
ripple::sfBalance
const SF_Amount sfBalance(access, STI_AMOUNT, 2, "Balance")
Definition: SField.h:424
ripple::sfTakerPaysCurrency
const SF_U160 sfTakerPaysCurrency(access, STI_HASH160, 1, "TakerPaysCurrency")
Definition: SField.h:395
ripple::sfDeliverMin
const SF_Amount sfDeliverMin(access, STI_AMOUNT, 10, "DeliverMin")
Definition: SField.h:432
ripple::sfOfferSequence
const SF_U32 sfOfferSequence(access, STI_UINT32, 25, "OfferSequence")
Definition: SField.h:362
ripple::SField
Identifies fields.
Definition: SField.h:112
ripple::sfTransactionHash
const SF_U256 sfTransactionHash(access, STI_HASH256, 3, "TransactionHash")
Definition: SField.h:403
ripple::STI_UINT64
@ STI_UINT64
Definition: SField.h:62
ripple::SField::num
static int num
Definition: SField.h:254
ripple::sfAffectedNodes
const SField sfAffectedNodes(access, STI_ARRAY, 8, "AffectedNodes")
Definition: SField.h:500
ripple::SField::getName
std::string const & getName() const
Definition: SField.h:168
ripple::sfReserveIncrement
const SF_U32 sfReserveIncrement(access, STI_UINT32, 32, "ReserveIncrement")
Definition: SField.h:369
Json::StaticString
Lightweight wrapper to tag static string.
Definition: json_value.h:62
std
STL namespace.
ripple::SField::isDiscardable
bool isDiscardable() const
Definition: SField.h:208
ripple::STI_HASH128
@ STI_HASH128
Definition: SField.h:63
ripple::sfRippleEscrow
const SF_Amount sfRippleEscrow(access, STI_AMOUNT, 17, "RippleEscrow")
Definition: SField.h:436
ripple::sfClearFlag
const SF_U32 sfClearFlag(access, STI_UINT32, 34, "ClearFlag")
Definition: SField.h:371
ripple::sfCondition
const SF_Blob sfCondition(access, STI_VL, 17, "Condition")
Definition: SField.h:456
ripple::sfPaths
const SField sfPaths(access, STI_PATHSET, 1, "Paths")
Definition: SField.h:470
ripple::sfTransactionResult
const SF_U8 sfTransactionResult(access, STI_UINT8, 3, "TransactionResult")
Definition: SField.h:326
ripple::sfCloseTime
const SF_U32 sfCloseTime(access, STI_UINT32, 7, "CloseTime")
Definition: SField.h:343
ripple::sfMemos
const SField sfMemos(access, STI_ARRAY, 9, "Memos")
Definition: SField.h:501
ripple::SField::compare
static int compare(const SField &f1, const SField &f2)
Definition: SField.cpp:280
ripple::STVector256
Definition: STVector256.h:29
ripple::sfSettleDelay
const SF_U32 sfSettleDelay(access, STI_UINT32, 39, "SettleDelay")
Definition: SField.h:376
ripple::sfTakerGets
const SF_Amount sfTakerGets(access, STI_AMOUNT, 5, "TakerGets")
Definition: SField.h:427
ripple::sfDigest
const SF_U256 sfDigest(access, STI_HASH256, 21, "Digest")
Definition: SField.h:417
ripple::SField::getCode
int getCode() const
Definition: SField.h:213
ripple::SField::isGeneric
bool isGeneric() const
Definition: SField.h:183
ripple::sfAccountHash
const SF_U256 sfAccountHash(access, STI_HASH256, 4, "AccountHash")
Definition: SField.h:404
ripple::sfDestination
const SF_Account sfDestination(access, STI_ACCOUNT, 3, "Destination")
Definition: SField.h:462
ripple::sfCheckID
const SF_U256 sfCheckID(access, STI_HASH256, 24, "CheckID")
Definition: SField.h:420
ripple::SField::fieldMeta
const int fieldMeta
Definition: SField.h:137
ripple::sfRootIndex
const SF_U256 sfRootIndex(access, STI_HASH256, 8, "RootIndex", SField::sMD_Always)
Definition: SField.h:408
ripple::sfTransferRate
const SF_U32 sfTransferRate(access, STI_UINT32, 11, "TransferRate")
Definition: SField.h:347
ripple::OptionaledField::f
TypedField< T > const * f
Definition: SField.h:281
ripple::sfLowNode
const SF_U64 sfLowNode(access, STI_UINT64, 7, "LowNode")
Definition: SField.h:385
ripple::sfCookie
const SF_U64 sfCookie(access, STI_UINT64, 10,"Cookie")
Definition: SField.h:388
ripple::sfBondAmount
const SF_U32 sfBondAmount(access, STI_UINT32, 23, "BondAmount")
Definition: SField.h:360
ripple::STI_OBJECT
@ STI_OBJECT
Definition: SField.h:69
ripple::sfAmendments
const SF_Vec256 sfAmendments(access, STI_VECTOR256, 3, "Amendments")
Definition: SField.h:475
ripple::SField::sMD_Default
@ sMD_Default
Definition: SField.h:123
ripple::sfBookNode
const SF_U64 sfBookNode(access, STI_UINT64, 3, "BookNode")
Definition: SField.h:381
ripple::sfTemplate
const SField sfTemplate(access, STI_ARRAY, 5, "Template")
Definition: SField.h:497
ripple::sfBaseFee
const SF_U64 sfBaseFee(access, STI_UINT64, 5, "BaseFee")
Definition: SField.h:383
ripple::SField::shouldMeta
bool shouldMeta(int c) const
Definition: SField.h:230
ripple::sfAuthorize
const SF_Account sfAuthorize(access, STI_ACCOUNT, 5, "Authorize")
Definition: SField.h:464
ripple::sfDeletedNode
const SField sfDeletedNode(access, STI_OBJECT, 4, "DeletedNode")
Definition: SField.h:481
ripple::sfCloseResolution
const SF_U8 sfCloseResolution(access, STI_UINT8, 1, "CloseResolution")
Definition: SField.h:324
ripple::sfNickname
const SF_U256 sfNickname(access, STI_HASH256, 18, "Nickname")
Definition: SField.h:414
ripple::sfConsensusHash
const SF_U256 sfConsensusHash(access, STI_HASH256, 23, "ConsensusHash")
Definition: SField.h:419
ripple::sfHighQualityOut
const SF_U32 sfHighQualityOut(access, STI_UINT32, 17, "HighQualityOut")
Definition: SField.h:354
ripple::SField::IsSigning::no
@ no
ripple::sfLedgerHash
const SF_U256 sfLedgerHash(access, STI_HASH256, 1, "LedgerHash")
Definition: SField.h:401
ripple::sfPreviousTxnID
const SF_U256 sfPreviousTxnID(access, STI_HASH256, 5, "PreviousTxnID", SField::sMD_DeleteFinal)
Definition: SField.h:405
ripple::sfCancelAfter
const SF_U32 sfCancelAfter(access, STI_UINT32, 36, "CancelAfter")
Definition: SField.h:373
ripple::SField::fieldNum
const int fieldNum
Definition: SField.h:138
ripple::sfEmailHash
const SF_U128 sfEmailHash(access, STI_HASH128, 1, "EmailHash")
Definition: SField.h:392
ripple::sfSetFlag
const SF_U32 sfSetFlag(access, STI_UINT32, 33, "SetFlag")
Definition: SField.h:370
ripple::sfTickSize
const SF_U8 sfTickSize(access, STI_UINT8, 16, "TickSize")
Definition: SField.h:327
ripple::sfExpireCode
const SF_Blob sfExpireCode(access, STI_VL, 10, "ExpireCode")
Definition: SField.h:448
ripple::sfMemoFormat
const SF_Blob sfMemoFormat(access, STI_VL, 14, "MemoFormat")
Definition: SField.h:452
ripple::SField::isSigningField
bool isSigningField() const
Definition: SField.h:226
ripple::sfInvoiceID
const SF_U256 sfInvoiceID(access, STI_HASH256, 17, "InvoiceID")
Definition: SField.h:413
ripple::STI_TRANSACTION
@ STI_TRANSACTION
Definition: SField.h:80
ripple::STI_NOTPRESENT
@ STI_NOTPRESENT
Definition: SField.h:57
ripple::operator~
constexpr ApplyFlags operator~(ApplyFlags const &flags)
Definition: ApplyView.h:84
ripple::sfStampEscrow
const SF_U32 sfStampEscrow(access, STI_UINT32, 22, "StampEscrow")
Definition: SField.h:359
ripple::sfTakerGetsIssuer
const SF_U160 sfTakerGetsIssuer(access, STI_HASH160, 4, "TakerGetsIssuer")
Definition: SField.h:398
ripple::sfDomain
const SF_Blob sfDomain(access, STI_VL, 7, "Domain")
Definition: SField.h:445