@@ -49,7 +49,7 @@ namespace fbcpp::impl
4949 {
5050 public:
5151 explicit CalendarConverter (Client& client, StatusWrapper* statusWrapper)
52- : client{client},
52+ : client{& client},
5353 statusWrapper{statusWrapper}
5454 {
5555 }
@@ -67,7 +67,7 @@ namespace fbcpp::impl
6767 if (yearValue <= 0 )
6868 throwInvalidDateValue ();
6969
70- return OpaqueDate{client. getUtil ()->encodeDate (static_cast <unsigned >(yearValue), monthValue, dayValue)};
70+ return OpaqueDate{client-> getUtil ()->encodeDate (static_cast <unsigned >(yearValue), monthValue, dayValue)};
7171 }
7272
7373 Date opaqueDateToDate (OpaqueDate date)
@@ -76,7 +76,7 @@ namespace fbcpp::impl
7676 unsigned month;
7777 unsigned day;
7878
79- client. getUtil ()->decodeDate (date.value , &year, &month, &day);
79+ client-> getUtil ()->decodeDate (date.value , &year, &month, &day);
8080
8181 return Date{std::chrono::year{static_cast <int >(year)}, std::chrono::month{month}, std::chrono::day{day}};
8282 }
@@ -140,7 +140,7 @@ namespace fbcpp::impl
140140 const auto subseconds = static_cast <unsigned >(time.subseconds ().count () / 100 );
141141
142142 OpaqueTime opaqueTime;
143- opaqueTime.value = client. getUtil ()->encodeTime (hours, minutes, seconds, subseconds);
143+ opaqueTime.value = client-> getUtil ()->encodeTime (hours, minutes, seconds, subseconds);
144144
145145 return opaqueTime;
146146 }
@@ -152,7 +152,7 @@ namespace fbcpp::impl
152152 unsigned seconds;
153153 unsigned subseconds;
154154
155- const auto util = client. getUtil ();
155+ const auto util = client-> getUtil ();
156156 util->decodeTime (time.value , &hours, &minutes, &seconds, &subseconds);
157157
158158 const auto timeOfDay = std::chrono::hours{hours} + std::chrono::minutes{minutes} +
@@ -252,7 +252,7 @@ namespace fbcpp::impl
252252
253253 OpaqueTimeTz opaque{};
254254
255- client. getUtil ()->encodeTimeTz (statusWrapper, &opaque.value , 0u , 0u , 0u , 0u , timeTz.zone .c_str ());
255+ client-> getUtil ()->encodeTimeTz (statusWrapper, &opaque.value , 0u , 0u , 0u , 0u , timeTz.zone .c_str ());
256256
257257 opaque.value .utc_time = static_cast <ISC_TIME >(duration.count () / 100 );
258258
@@ -269,7 +269,7 @@ namespace fbcpp::impl
269269 unsigned fractions;
270270 std::array<char , 128 > timeZoneBuffer;
271271
272- client. getUtil ()->decodeTimeTz (statusWrapper, &opaqueTime.value , &hours, &minutes, &seconds, &fractions,
272+ client-> getUtil ()->decodeTimeTz (statusWrapper, &opaqueTime.value , &hours, &minutes, &seconds, &fractions,
273273 static_cast <unsigned >(timeZoneBuffer.size ()), timeZoneBuffer.data ());
274274
275275 TimeTz timeTz;
@@ -295,7 +295,7 @@ namespace fbcpp::impl
295295 unsigned fractions;
296296 std::array<char , 128 > timeZoneBuffer;
297297
298- client. getUtil ()->decodeTimeTz (statusWrapper, &time.value , &hours, &minutes, &seconds, &fractions,
298+ client-> getUtil ()->decodeTimeTz (statusWrapper, &time.value , &hours, &minutes, &seconds, &fractions,
299299 static_cast <unsigned >(timeZoneBuffer.size ()), timeZoneBuffer.data ());
300300
301301 return std::format (" {:02}:{:02}:{:02}.{:04} {}" , hours, minutes, seconds, fractions, timeZoneBuffer.data ());
@@ -360,7 +360,7 @@ namespace fbcpp::impl
360360
361361 OpaqueTimeTz encoded;
362362 const std::string timeZoneString{makeComponentView (5 )};
363- client. getUtil ()->encodeTimeTz (
363+ client-> getUtil ()->encodeTimeTz (
364364 statusWrapper, &encoded.value , hours, minutes, seconds, fractions, timeZoneString.c_str ());
365365
366366 return opaqueTimeTzToTimeTz (encoded);
@@ -389,7 +389,7 @@ namespace fbcpp::impl
389389 OpaqueTimestamp opaqueTimestamp;
390390 opaqueTimestamp.value .timestamp_date = opaqueDate.value ;
391391 opaqueTimestamp.value .timestamp_time =
392- client. getUtil ()->encodeTime (static_cast <unsigned >(timestamp.time .hours ().count ()),
392+ client-> getUtil ()->encodeTime (static_cast <unsigned >(timestamp.time .hours ().count ()),
393393 static_cast <unsigned >(timestamp.time .minutes ().count ()),
394394 static_cast <unsigned >(timestamp.time .seconds ().count ()), static_cast <unsigned >(subseconds / 100 ));
395395
@@ -406,7 +406,7 @@ namespace fbcpp::impl
406406 unsigned seconds;
407407 unsigned subseconds;
408408
409- const auto util = client. getUtil ();
409+ const auto util = client-> getUtil ();
410410 util->decodeDate (timestamp.value .timestamp_date , &year, &month, &day);
411411 util->decodeTime (timestamp.value .timestamp_time , &hours, &minutes, &seconds, &subseconds);
412412
@@ -513,7 +513,7 @@ namespace fbcpp::impl
513513 {
514514 OpaqueTimestampTz opaque;
515515
516- client. getUtil ()->encodeTimeStampTz (
516+ client-> getUtil ()->encodeTimeStampTz (
517517 statusWrapper, &opaque.value , 1u , 1u , 1u , 0u , 0u , 0u , 0u , timestampTz.zone .c_str ());
518518
519519 const auto utcOpaque = timestampToOpaqueTimestamp (timestampTz.utcTimestamp );
@@ -539,7 +539,7 @@ namespace fbcpp::impl
539539 unsigned subseconds;
540540 std::array<char , 128 > timeZoneBuffer;
541541
542- client. getUtil ()->decodeTimeStampTz (statusWrapper, &opaqueTimestamp.value , &year, &month, &day, &hours,
542+ client-> getUtil ()->decodeTimeStampTz (statusWrapper, &opaqueTimestamp.value , &year, &month, &day, &hours,
543543 &minutes, &seconds, &subseconds, static_cast <unsigned >(timeZoneBuffer.size ()), timeZoneBuffer.data ());
544544
545545 TimestampTz timestampTz;
@@ -569,7 +569,7 @@ namespace fbcpp::impl
569569 unsigned subseconds;
570570 std::array<char , 128 > timeZoneBuffer;
571571
572- client. getUtil ()->decodeTimeStampTz (statusWrapper, ×tamp.value , &year, &month, &day, &hours, &minutes,
572+ client-> getUtil ()->decodeTimeStampTz (statusWrapper, ×tamp.value , &year, &month, &day, &hours, &minutes,
573573 &seconds, &subseconds, static_cast <unsigned >(timeZoneBuffer.size ()), timeZoneBuffer.data ());
574574
575575 return std::format (" {:04}-{:02}-{:02} {:02}:{:02}:{:02}.{:04} {}" , year, month, day, hours, minutes,
@@ -648,7 +648,7 @@ namespace fbcpp::impl
648648
649649 OpaqueTimestampTz encoded;
650650 const std::string timeZoneString{makeComponentView (8 )};
651- client. getUtil ()->encodeTimeStampTz (statusWrapper, &encoded.value ,
651+ client-> getUtil ()->encodeTimeStampTz (statusWrapper, &encoded.value ,
652652 static_cast <unsigned >(static_cast <int >(date.year ())), monthValue, dayValue, hours, minutes, seconds,
653653 fractions, timeZoneString.c_str ());
654654
@@ -674,7 +674,7 @@ namespace fbcpp::impl
674674 isc_arg_end,
675675 };
676676
677- throw DatabaseException (client, STATUS_CONVERSION_ERROR_FROM_STRING );
677+ throw DatabaseException (* client, STATUS_CONVERSION_ERROR_FROM_STRING );
678678 }
679679
680680 [[noreturn]] void throwInvalidDateValue ()
@@ -684,7 +684,7 @@ namespace fbcpp::impl
684684 isc_arg_end,
685685 };
686686
687- throw DatabaseException (client, STATUS_INVALID_DATE_VALUE );
687+ throw DatabaseException (* client, STATUS_INVALID_DATE_VALUE );
688688 }
689689
690690 [[noreturn]] void throwInvalidTimeValue ()
@@ -694,7 +694,7 @@ namespace fbcpp::impl
694694 isc_arg_end,
695695 };
696696
697- throw DatabaseException (client, STATUS_INVALID_TIME_VALUE );
697+ throw DatabaseException (* client, STATUS_INVALID_TIME_VALUE );
698698 }
699699
700700 [[noreturn]] void throwInvalidTimestampValue ()
@@ -704,15 +704,15 @@ namespace fbcpp::impl
704704 isc_arg_end,
705705 };
706706
707- throw DatabaseException (client, STATUS_INVALID_TIMESTAMP_VALUE );
707+ throw DatabaseException (* client, STATUS_INVALID_TIMESTAMP_VALUE );
708708 }
709709
710710 private:
711711 static constexpr auto TICKS_PER_DAY = std::int64_t {24 } * 60 * 60 * 10000 ;
712712 static constexpr auto BASE_EPOCH = std::chrono::local_days{
713713 std::chrono::year{1858 } / std::chrono::November / 17 ,
714714 };
715- Client& client;
715+ Client* client;
716716 StatusWrapper* statusWrapper;
717717 };
718718} // namespace fbcpp::impl
0 commit comments