Qore Mapper Module Reference 1.6.2
All Classes Namespaces Functions Variables Modules Pages
Mapper.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* Mapper.qm Copyright 2014 - 2024 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
25// minimum required Qore version
26
27// require type definitions everywhere
28
29// enable all warnings
30
31// do not use "$" for vars
32
33// common definitions
34
35// supports using the DataProvider module to describe input and output records
36
37
415namespace Mapper {
417public hashdecl MapperOptionInfo {
419 string type;
420
422 string desc;
423};
424
427
428public:
430 const ConstantConflictList = ("name", "struct", "code", "default");
431
433 const OptionKeys = ...;
434
435
437 const UserOptions = ...;
438
439
441 const ValidKeys = ...;
442
443
445 const OutputKeys = ...;
446
447
449 static Type recordType("hash<string, AbstractDataField>");
450
451protected:
453
455 hash mapc;
456
458 hash<auto> mapd;
459
461 hash<auto> mapo;
462
464 *string name;
465
467 *code info_log;
468
471
474
477
480
482 hash<auto> global_transform_opts = {} + {
483 "date.input_timezone": TimeZone::get(),
484 };
485
487 bool trunc_all = False;
488
490
494 bool allow_dot = False;
495
497
501 bool allow_output_dot = False;
502
504 *hash<string, AbstractDataField> input;
505
507 *AbstractDataProvider input_provider;
508
511
514
517
520
523
526
529
532
534 *hash<string, AbstractDataField> output;
535
537 *AbstractDataProvider output_provider;
538
540 *AbstractDataProviderBulkOperation output_provider_bulk_operation;
541
544
547
550
553
555 bool output_nullable = False;
556
559
562
565
567 int count = 0;
568
570
572 *hash<auto> m_runtime;
573
575 hash<auto> identh;
576
578 *list<auto> identl;
579
581 hash<auto> consth;
582
584 hash<auto> rconsth;
585
587 hash<string, hash<MapperRuntimeKeyInfo>> runtime_keys;
588
590 hash<string, hash<auto>> runtime_keys_with_handler;
591
593 hash<string, hash<MapperRuntimeKeyInfo>> runtime_independent_keys;
594
596 hash<string, bool> valid_keys;
597
599 hash<auto> mapper_handler_context = {};
600
603
605 *hash<auto> global_submappers;
606
609
612
614 const TypeMap = ...;
615
616
618 const DeprecatedGlobalTransformOptionMap = ...;
619
620
622 const _Mapper_Thread_Key = "_Mapper_Thread_Key";
623
624public:
625
627
652 constructor(hash<auto> mapv, *hash<auto> opts);
653
654
656protected:
658public:
659
660
661 static hash<string, AbstractDataField> getInputFromHash(hash<auto> input);
662
663 static hash<string, AbstractDataField> getOutputFromHash(hash<auto> output, *hash<auto> mapv, *hash<auto> global_options);
664
666
672protected:
673 submitImpl(code enqueue, auto _data);
674public:
675
676
678
680protected:
682public:
683
684
686protected:
687 *AbstractDataProviderType getExpectedTypeImpl();
688public:
689
690
692protected:
693 *AbstractDataProviderType getReturnTypeImpl();
694public:
695
696
697protected:
698 AbstractDataProviderType getOutputType(hash<auto> hdesc, *hash<auto> mapdesc);
699public:
700
701
702protected:
703 static AbstractDataProviderType getOutputType(hash<auto> hdesc, *hash<auto> mapdesc, *hash<auto> global_options, *bool has_default_value);
704public:
705
706
707protected:
708 static hash<string, AbstractDataField> getInputFromHashIntern(hash<auto> input, *reference<bool> structured_input);
709public:
710
711
712protected:
713 static hash<string, AbstractDataField> getOutputFromHashIntern(hash<auto> output, *hash<auto> mapv, *hash<auto> global_options, *reference<bool> structured_output);
714public:
715
716
717protected:
718 checkInputOutputOption(hash<auto> opts, string var, *hash<auto> mapv);
719public:
720
721
722protected:
723 setInputProvider(hash<auto> opts);
724public:
725
726
727private:
728 *hash<string, AbstractDataField> getFields(string pfx, AbstractDataProviderType type);
729public:
730
731
732protected:
733 setOutputProvider(hash<auto> opts);
734public:
735
736
738protected:
739 setup(hash<auto> mapv, *hash<auto> opts);
740public:
741
742
744protected:
746public:
747
748
750protected:
751 convertToHash(int t, string k, reference<auto> fh);
752public:
753
754
756protected:
757 processStructuredInputField(string k, string name, reference<list<string>> struct);
758public:
759
760
762protected:
763 *AbstractDataField processStructuredOutputField(string k, reference<hash<auto>> fh);
764public:
765
766
768protected:
769 checkInputField(string k, string name);
770public:
771
772
774 static list<string> splitDottedFields(string k);
775
777
780protected:
781 checkMapField(string k, reference<auto> fh);
782public:
783
784
786protected:
788public:
789
790
792
810 setRuntime(string key, auto value);
811
812
814
832 setRuntime(hash<auto> runtime);
833
834
836
854 replaceRuntime(*hash<auto> runtime);
855
856
858
869 auto getRuntime(string key);
870
871
873 string getFieldName(string fname);
874
875
877
879 hash<string, bool> validKeys();
880
881
883
885 hash<auto> optionKeys();
886
887
889 hash<string, hash<MapperOptionInfo>> getUserOptions();
890
891
893 *AbstractDataProvider getInputProvider();
894
895
897 *AbstractDataProvider getOutputProvider();
898
899
901 *hash<string, AbstractDataField> getInputRecord();
902
903
905 *hash<string, AbstractDataField> getOutputRecord();
906
907
909
912
913
915
923
924
926
933
934
936
943
944
946
955
956
958
967
968
970
977
978
980
985 *softlist<hash<auto>> mapAutoInput();
986
987
989
991private:
992 AbstractDataProviderRecordIterator getInputProviderRecordIterator();
993public:
994
995
997
1006 list<hash<auto>> mapAll(list<auto> recs);
1007
1008
1010
1019 list<hash<auto>> mapAll(hash<auto> recs);
1020
1021
1023
1032 list<hash<auto>> mapAll(AbstractIterator recs);
1033
1034
1036
1048 hash<auto> mapData(hash<auto> rec);
1049
1050
1052
1068 auto mapAuto(auto recs);
1069
1070
1072
1098 *hash<auto> mapBulk(hash<auto> rec, *hash<auto> crec);
1099
1100
1102 static *hash<auto> getMapperThreadContext();
1103
1105
1123protected:
1124 hash<auto> mapDataIntern(hash<auto> rec, *bool do_log_output);
1125public:
1126
1127
1129protected:
1130 *hash<auto> doCreateRecordIntern(hash<auto> rec);
1131public:
1132
1133
1135protected:
1136 static *hash<auto> swapMapperThreadContext(*hash<auto> new_ctx);
1137public:
1138
1139
1147protected:
1148 *int getRecListSize(hash<auto> rec);
1149public:
1150
1151
1153
1179protected:
1180 nothing mapFieldIntern(reference<hash<auto>> h, string key, hash<auto> rec, bool do_list, int list_size);
1181public:
1182
1183
1185 hash<auto> getOptionsFromTemplate(hash<auto> opts, hash<auto> input_rec, *hash<auto> output_rec);
1186
1187
1188 // recursively remove a key from the output
1189protected:
1190 removeHashOutputKey(reference<auto> output, list<auto> path, int offset);
1191public:
1192
1193
1194 // recursively write output hash
1195protected:
1196 writeHashOutput(reference<auto> output, auto value, list<auto> path, int offset);
1197public:
1198
1199
1201protected:
1202 string truncateField(string k, string val, int ix, int sze, int maxlen);
1203public:
1204
1205
1207protected:
1208 fieldLengthError(string k, string val, int ix, int sze, int maxlen, hash<auto> rc);
1209public:
1210
1211
1213 logOutput(hash<auto> h);
1214
1215
1217
1220
1221
1223
1226
1227
1229protected:
1230 auto mapFieldType(string key, hash<auto> mapping, AbstractDataProviderType type, auto value, hash<auto> rec, auto v);
1231public:
1232
1233
1235protected:
1236 string getMappingDescription(string key, hash<auto> mapping);
1237public:
1238
1239
1241protected:
1243public:
1244
1245
1247
1249protected:
1251public:
1252
1253
1255
1257protected:
1259public:
1260
1261
1263
1265protected:
1266 error(string fmt, ...);
1267public:
1268
1269
1271protected:
1272 error2(string ex, string fmt, ...);
1273public:
1274
1275
1277protected:
1278 auto mapSubclass(hash<auto> m, auto v);
1279public:
1280
1281
1282protected:
1283 static AbstractDataProviderType getInputType(*string type);
1284public:
1285
1286};
1287
1290
1291public:
1292
1293protected:
1296
1297public:
1298
1300
1303
1304
1306 bool next();
1307
1308
1310 bool valid();
1311
1312
1314 bool hasBulk();
1315
1316
1318
1322 list<hash> mapBulk(int size);
1323
1324};
1325
1328
1329public:
1330
1331protected:
1334
1335public:
1336
1338
1344 constructor(Qore::AbstractIterator i, hash<auto> mapv, *hash<auto> opts) ;
1345
1346
1348
1352
1353
1355 hash<auto> getValue();
1356
1357
1359
1362
1363
1365
1368
1369};
1370
1372class AnythingDataType : public AbstractDataProviderType {
1373
1374public:
1375protected:
1377 const SupportedOptions = ...;
1378
1379
1380public:
1381
1383 constructor(*hash<auto> options) ;
1384
1385
1387 string getName();
1388
1389
1391 string getDesc();
1392
1393
1395 bool isAssignableFrom(AbstractDataProviderType t);
1396
1397
1399 bool isAssignableFrom(Type t);
1400
1401
1404
1405
1407 *AbstractDataProviderType getElementType();
1408
1409
1411
1417 auto acceptsValue(auto value);
1418
1419
1421 *hash<string, AbstractDataField> getFields();
1422
1423
1425 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
1426
1427
1429 hash<string, bool> getAcceptTypeHash(*bool simple);
1430
1431
1433 hash<string, bool> getReturnTypeHash(*bool simple);
1434
1435};
1436
1439
1440public:
1442 constructor(*hash<auto> options) ;
1443
1444
1446 string getName();
1447
1448
1450 bool isAssignableFrom(AbstractDataProviderType t);
1451
1452
1454 bool isAssignableFrom(Type t);
1455
1456
1459
1460
1462
1468 auto acceptsValue(auto value);
1469
1470};
1471
1473class MapperOutputRecordIterator : public AbstractDataProviderRecordIterator {
1474
1475public:
1476protected:
1479
1481 AbstractDataProviderRecordIterator i;
1482
1483public:
1484
1486 constructor(Mapper mapper, AbstractDataProvider input, *hash<auto> where_cond, *hash<auto> search_options);
1487
1488
1490 bool next();
1491
1492
1494 hash<auto> getValue();
1495
1496
1498 bool valid();
1499
1500};
1501};
abstract base class for hash iterator mappping classes based on a mapper object and an iterator input...
Definition Mapper.qm.dox.h:1289
list< hash > mapBulk(int size)
performs bulk mapping; if the iterator does not support bulk mapping then it is simulated in this met...
bool next()
Moves the current position of the iterator to the next element; returns False if there are no more el...
bool valid()
returns True if the iterator is currently pointing at a valid element, False if not
constructor(Qore::AbstractIterator iter)
creates the iterator from the arguments passed
bool hasBulk()
returns True if the iterator supports bulk mode; this method returns False (the default)
Qore::AbstractIterator i
input iterator; AbstractIterator::getValue() must return a hash
Definition Mapper.qm.dox.h:1295
describes a data type that accepts any value; stores "string.max_size_chars" as a type attribute for ...
Definition Mapper.qm.dox.h:1372
hash< string, bool > getReturnTypeHash(*bool simple)
returns a hash of base types returned by this type
string getDesc()
Returns the description.
bool isAssignableFrom(Type t)
returns True if this type can be assigned from values of the argument type
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options
bool isAssignableFrom(AbstractDataProviderType t)
returns True if this type can be assigned from values of the argument type
constructor(*hash< auto > options)
creates the object
const SupportedOptions
supports a max_size_chars option for strings; to be enforced externally
Definition Mapper.qm.dox.h:1377
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
*Type getValueType()
returns the base type for the type, if any
*AbstractDataProviderType getElementType()
returns the subtype (for lists or hashes) if there is only one
*hash< string, AbstractDataField > getFields()
returns the fields of the data structure; if any
hash< string, bool > getAcceptTypeHash(*bool simple)
returns a hash of base types accepted by this type
string getName()
returns the type name
this class is a base class for mapping data; see Mapper Examples for usage examples
Definition Mapper.qm.dox.h:426
checkOutputBulkOperation()
raises an error if no output provider is present
constructor()
private constructor for subclasses
auto input_request
the argument for the request/response API for the input provider
Definition Mapper.qm.dox.h:519
fieldLengthError(string k, string val, int ix, int sze, int maxlen, hash< auto > rc)
called when a field exceeds its maximum length when processing hashes of lists
*hash< string, AbstractDataField > input
an optional description of possible input hash keys
Definition Mapper.qm.dox.h:504
checkMapField(string k, reference< auto > fh)
perform per-field pre-processing on the passed map in the constructor
string getFieldName(string fname)
returns a descriptive name of the given field if possible, otherwise returns the field name itself
static *hash< auto > getMapperThreadContext()
Get mapper thread context.
checkTimezoneOption(string rn)
verifies a timezone constructor option
hash< auto > mapDataIntern(hash< auto > rec, *bool do_log_output)
processes the input record and returns a hash of the mapped values
*hash< string, AbstractDataField > getOutputRecord()
returns the value of the "output" option
bool structured_output
flag if the field descriptions were provided to the constructor
Definition Mapper.qm.dox.h:561
bool output_create_ignore_duplicates
flag indicating that duplicate records should be ignored when creating records with an output mapper
Definition Mapper.qm.dox.h:564
bool input_do_request
indicates that the request/response API should be used for mapper input
Definition Mapper.qm.dox.h:516
hash< string, hash< auto > > runtime_keys_with_handler
subset of runtime_keys with handlers
Definition Mapper.qm.dox.h:590
bool input_request_search
a boolean flag that indicates that an input provider that supports both the record API and the reques...
Definition Mapper.qm.dox.h:525
logOutput(hash< auto > h)
calls the output logging closure or call reference (if any) to log the output record
discardOutput()
Discards any buffered data in the output data provider in a bulk operation.
bool output_suppress_data_provider
ignore any output data provider; use for type info only
Definition Mapper.qm.dox.h:611
list< hash< auto > > mapAll(hash< auto > recs)
maps all input records and returns the mapped data as a list of output records
error(string fmt,...)
throws a MAP-ERROR exception; prepends the map name to the description if known
hash< auto > consth
map of constant fields
Definition Mapper.qm.dox.h:581
hash< auto > optionKeys()
returns a list of valid constructor options for this class (can be overridden in subclasses)
*AbstractDataField processStructuredOutputField(string k, reference< hash< auto > > fh)
Raises an error if invalid fields in structured output data are declared; sets "fh".
convertToHash(int t, string k, reference< auto > fh)
convert a field definition to a hash if possible
auto mapFieldType(string key, hash< auto > mapping, AbstractDataProviderType type, auto value, hash< auto > rec, auto v)
performs type handling
processStructuredInputField(string k, string name, reference< list< string > > struct)
raises an error if invalid fields in structured input data are declared; sets "struct"
checkInputProvider()
raises an error if no input provider is present
hash< auto > getOptionsFromTemplate(hash< auto > opts, hash< auto > input_rec, *hash< auto > output_rec)
Returns options from a template hash.
bool disable_bulk
disable bulk operations when there is a hash of lists as input when calling mapAuto
Definition Mapper.qm.dox.h:531
bool output_provider_upsert
if the upsert operations should be used on the output provider
Definition Mapper.qm.dox.h:546
rollback()
Rolls back data written to the output data provider.
*hash< auto > input_provider_search
search conditions for the input provider
Definition Mapper.qm.dox.h:510
*hash< string, AbstractDataField > output
an optional description of the output data structure
Definition Mapper.qm.dox.h:534
MapperOutputRecordIterator getOutputIterator()
returns an output record iterator that produces mapped data from the input data provider
bool supportsBulkApiImpl()
Returns True if the record processor supports bulk operation.
static list< string > splitDottedFields(string k)
Splits a dotted field and replaces escaped (.) dots with plain dots (.)
*AbstractDataProvider output_provider
the optional output data provider
Definition Mapper.qm.dox.h:537
checkInputField(string k, string name)
raises an error if an invalid input field name is declared; only call this if "input" is defined
flushOutput()
Flushes any remaining data to the output data provider in a bulk operation.
auto getRuntime(string key)
get current runtime option value for a key
runAutonomous()
Runs the input and output mappers with data providers on each end autonomously.
*AbstractDataProviderType getReturnTypeImpl()
Returns the type of data that will be returned, if available.
replaceRuntime(*hash< auto > runtime)
replaces runtime options
hash< auto > identh
map of fields to be mapped 1:1 input -> output
Definition Mapper.qm.dox.h:575
static *hash< auto > swapMapperThreadContext(*hash< auto > new_ctx)
Swap the mapper thread context.
*code output_log
an optional output data logging callback; must accept a hash giving the output data hash
Definition Mapper.qm.dox.h:473
*code submapper_get
an optional callback for retrieving a nested mapper; sig: (string name, *hash<auto> opts) {}
Definition Mapper.qm.dox.h:476
AbstractDataProviderRecordIterator getInputProviderRecordIterator()
returns a record iterator for an input provider
hash< auto > mapd
the hash with a subset of the mappings used dynamically
Definition Mapper.qm.dox.h:458
*code input_log
an optional input data logging callback; must accept a hash giving the input data hash
Definition Mapper.qm.dox.h:470
*softlist< hash< auto > > mapAutoInput()
Runs the input data provider through the mapper and returns the output.
*int getRecListSize(hash< auto > rec)
*AbstractDataProvider getOutputProvider()
returns the output provider
setRuntime(hash< auto > runtime)
adds runtime options to the current runtime option hash
static Type recordType("hash<string, AbstractDataField>")
the input and output record type
hash< auto > mapData(hash< auto > rec)
processes the input record and returns a hash of the mapped values where the keys in the hash returne...
int getCount()
returns the internal record count
hash< auto > mapo
the hash of output records for key order
Definition Mapper.qm.dox.h:461
*AbstractDataProviderBulkOperation output_provider_bulk_operation
bulk output object for an output data provider
Definition Mapper.qm.dox.h:540
bool output_provider_passive
if the output provide should only be used to set the output type
Definition Mapper.qm.dox.h:543
hash< string, hash< MapperRuntimeKeyInfo > > runtime_keys
map of field keys provided by the "runtime_keys" option
Definition Mapper.qm.dox.h:587
*hash< auto > input_search_options
search options for the input provider
Definition Mapper.qm.dox.h:513
nothing mapFieldIntern(reference< hash< auto > > h, string key, hash< auto > rec, bool do_list, int list_size)
maps a single field to the target
bool input_suppress_data_provider
ignore any input data provider; use for type info only
Definition Mapper.qm.dox.h:608
*hash< string, AbstractDataField > getInputRecord()
returns the value of the "input" option
*string name
the optional name for the object (for example a table name); will be prepended to field names in erro...
Definition Mapper.qm.dox.h:464
checkOutputProvider()
raises an error if no output provider is present
*hash< auto > mapper_thread_context
mapper static thread context hash
Definition Mapper.qm.dox.h:602
hash< string, hash< MapperOptionInfo > > getUserOptions()
returns mapper options useful for users
*hash< auto > output_request_options
options for the request when using the request/response API for the output provider
Definition Mapper.qm.dox.h:552
hash< string, hash< MapperRuntimeKeyInfo > > runtime_independent_keys
hash of runtime keys that provide independent mappings (where there is no "requires_role" = "value")
Definition Mapper.qm.dox.h:593
hash< string, bool > valid_keys
hash of valid keys
Definition Mapper.qm.dox.h:596
auto mapSubclass(hash< auto > m, auto v)
to be overridden as necessary in subclasses
*hash< auto > global_submappers
global submapper hash
Definition Mapper.qm.dox.h:605
string truncateField(string k, string val, int ix, int sze, int maxlen)
called to truncate fields when processing hashes of lists
*hash< auto > input_request_options
options for the request when using the request/response API for the input provider
Definition Mapper.qm.dox.h:522
*hash< auto > doCreateRecordIntern(hash< auto > rec)
Creates a record with the output data provider.
submitImpl(code enqueue, auto _data)
Submits the data for processing by the mapper.
hash< auto > rconsth
map of constant runtime fields
Definition Mapper.qm.dox.h:584
*code template_subst
an optional callback for substituting templated values
Definition Mapper.qm.dox.h:479
*AbstractDataProvider getInputProvider()
returns the input provider
auto mapAuto(auto recs)
maps all input record(s) automatically and returns the mapped data
setNullableOutput()
sets all fields in the output record as nullable
hash mapc
the hash providing output field names and mappings
Definition Mapper.qm.dox.h:455
*code info_log
an optional info logging callback; must accept a sprintf()-style format specifier and optional argume...
Definition Mapper.qm.dox.h:467
*AbstractDataProviderType getExpectedTypeImpl()
Returns the expected type of data to be submitted, if available.
list< hash< auto > > mapAll(list< auto > recs)
maps all input records and returns the mapped data as a list of output records
setup(hash< auto > mapv, *hash< auto > opts)
sets up the mapper object before checking the mapper hash
checkMap()
verifies the input map in the constructor
commit()
Commits data written to the output data provider if the output data provider supports transaction man...
*hash< auto > m_runtime
current runtime values
Definition Mapper.qm.dox.h:572
bool output_do_request
indicates that the request/response API should be used for mapper output
Definition Mapper.qm.dox.h:549
resetCount()
resets the internal record count
setRuntime(string key, auto value)
set the runtime option with "key" to value "value"
string getMappingDescription(string key, hash< auto > mapping)
returns a test description for the input mapping
hash< string, bool > validKeys()
returns a list of valid field keys for this class (can be overridden in subclasses)
error2(string ex, string fmt,...)
throws the given exception; prepends the map name to the description if known
constructor(hash< auto > mapv, *hash< auto > opts)
builds the object based on a hash providing field mappings, data constraints, and optionally custom m...
*AbstractDataProvider input_provider
the optional input data provider
Definition Mapper.qm.dox.h:507
list< hash< auto > > mapAll(AbstractIterator recs)
maps all input records and returns the mapped data as a list of output records
bool structured_input
flag if the field descriptions were provided to the constructor
Definition Mapper.qm.dox.h:558
bool ignore_missing_input
suppresses the output field if the input field is missing and the output is optional
Definition Mapper.qm.dox.h:528
*hash< auto > mapBulk(hash< auto > rec, *hash< auto > crec)
maps a set of records in hash of lists format; returns mapped data in a hash of lists format
*list< auto > identl
list of fields to be mapped 1:1 input -> output
Definition Mapper.qm.dox.h:578
provides a hash iterator based on a mapper object and an iterator input source
Definition Mapper.qm.dox.h:1327
constructor(Qore::AbstractIterator i, Mapper::Mapper mapv)
creates the iterator from the arguments passed
constructor(Qore::AbstractIterator i, hash< auto > mapv, *hash< auto > opts)
creates the iterator from the arguments passed
resetCount()
resets the internal record count
Mapper::Mapper mapc
data mapper
Definition Mapper.qm.dox.h:1333
int getCount()
returns the internal record count
hash< auto > getValue()
returns the current row transformed with the mapper
Output record iterator for Mapper objects with an input data provider.
Definition Mapper.qm.dox.h:1473
bool valid()
Returns True if the iterator is currently pointing at a valid element, False if not.
constructor(Mapper mapper, AbstractDataProvider input, *hash< auto > where_cond, *hash< auto > search_options)
Creates the object from the arguments.
AbstractDataProviderRecordIterator i
the input data provider
Definition Mapper.qm.dox.h:1481
Mapper mapper
the mapper
Definition Mapper.qm.dox.h:1478
bool next()
Moves the current position to the next element; returns False if there are no more elements.
hash< auto > getValue()
Returns the mapped value of the current input record.
describes a data type that accepts any value except NOTHING; stores "string.max_size_chars" as a type...
Definition Mapper.qm.dox.h:1438
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
*Type getValueType()
returns the base type for the type, if any
bool isAssignableFrom(Type t)
returns True if this type can be assigned from values of the argument type
bool isAssignableFrom(AbstractDataProviderType t)
returns True if this type can be assigned from values of the argument type
string getName()
returns the type name
constructor(*hash< auto > options)
creates the object
the Mapper namespace contains all the definitions in the Mapper module
describes type options
Definition Mapper.qm.dox.h:417
string type
the option value type
Definition Mapper.qm.dox.h:419
string desc
the description of the option
Definition Mapper.qm.dox.h:422