// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include "../inst/include/qlcal.h"
#include "../inst/include/qlcal_types.h"
#include <Rcpp.h>
#include <string>
#include <set>

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// setCalendar
void setCalendar(std::string calstr);
static SEXP _qlcal_setCalendar_try(SEXP calstrSEXP) {
BEGIN_RCPP
    Rcpp::traits::input_parameter< std::string >::type calstr(calstrSEXP);
    setCalendar(calstr);
    return R_NilValue;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_setCalendar(SEXP calstrSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_setCalendar_try(calstrSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// advanceDate
Rcpp::Date advanceDate(Rcpp::Date rd, int days, const std::string& unit, const std::string& bdc, bool eom, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_advanceDate_try(SEXP rdSEXP, SEXP daysSEXP, SEXP unitSEXP, SEXP bdcSEXP, SEXP eomSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Date >::type rd(rdSEXP);
    Rcpp::traits::input_parameter< int >::type days(daysSEXP);
    Rcpp::traits::input_parameter< const std::string& >::type unit(unitSEXP);
    Rcpp::traits::input_parameter< const std::string& >::type bdc(bdcSEXP);
    Rcpp::traits::input_parameter< bool >::type eom(eomSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(advanceDate(rd, days, unit, bdc, eom, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_advanceDate(SEXP rdSEXP, SEXP daysSEXP, SEXP unitSEXP, SEXP bdcSEXP, SEXP eomSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_advanceDate_try(rdSEXP, daysSEXP, unitSEXP, bdcSEXP, eomSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// isBusinessDay
Rcpp::LogicalVector isBusinessDay(Rcpp::Nullable<Rcpp::DateVector> dates, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_isBusinessDay_try(SEXP datesSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::DateVector> >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(isBusinessDay(dates, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_isBusinessDay(SEXP datesSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_isBusinessDay_try(datesSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// isHoliday
Rcpp::LogicalVector isHoliday(Rcpp::Nullable<Rcpp::DateVector> dates, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_isHoliday_try(SEXP datesSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::DateVector> >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(isHoliday(dates, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_isHoliday(SEXP datesSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_isHoliday_try(datesSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// isWeekend
Rcpp::LogicalVector isWeekend(Rcpp::Nullable<Rcpp::DateVector> dates, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_isWeekend_try(SEXP datesSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::DateVector> >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(isWeekend(dates, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_isWeekend(SEXP datesSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_isWeekend_try(datesSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// isEndOfMonth
Rcpp::LogicalVector isEndOfMonth(Rcpp::Nullable<Rcpp::DateVector> dates, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_isEndOfMonth_try(SEXP datesSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::DateVector> >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(isEndOfMonth(dates, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_isEndOfMonth(SEXP datesSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_isEndOfMonth_try(datesSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getEndOfMonth
Rcpp::DateVector getEndOfMonth(Rcpp::DateVector dates, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_getEndOfMonth_try(SEXP datesSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::DateVector >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(getEndOfMonth(dates, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getEndOfMonth(SEXP datesSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getEndOfMonth_try(datesSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// adjust_cpp
Rcpp::DateVector adjust_cpp(Rcpp::DateVector dates, int bdc, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> cal);
static SEXP _qlcal_adjust_cpp_try(SEXP datesSEXP, SEXP bdcSEXP, SEXP calSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::DateVector >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< int >::type bdc(bdcSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type cal(calSEXP);
    rcpp_result_gen = Rcpp::wrap(adjust_cpp(dates, bdc, cal));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_adjust_cpp(SEXP datesSEXP, SEXP bdcSEXP, SEXP calSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_adjust_cpp_try(datesSEXP, bdcSEXP, calSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// advanceUnits_cpp
Rcpp::DateVector advanceUnits_cpp(Rcpp::DateVector dates, int n, int unit, int bdc, bool emr, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> cal);
static SEXP _qlcal_advanceUnits_cpp_try(SEXP datesSEXP, SEXP nSEXP, SEXP unitSEXP, SEXP bdcSEXP, SEXP emrSEXP, SEXP calSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::DateVector >::type dates(datesSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    Rcpp::traits::input_parameter< int >::type unit(unitSEXP);
    Rcpp::traits::input_parameter< int >::type bdc(bdcSEXP);
    Rcpp::traits::input_parameter< bool >::type emr(emrSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type cal(calSEXP);
    rcpp_result_gen = Rcpp::wrap(advanceUnits_cpp(dates, n, unit, bdc, emr, cal));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_advanceUnits_cpp(SEXP datesSEXP, SEXP nSEXP, SEXP unitSEXP, SEXP bdcSEXP, SEXP emrSEXP, SEXP calSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_advanceUnits_cpp_try(datesSEXP, nSEXP, unitSEXP, bdcSEXP, emrSEXP, calSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// businessDaysBetween
Rcpp::NumericVector businessDaysBetween(Rcpp::DateVector from, Rcpp::DateVector to, bool includeFirst, bool includeLast, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_businessDaysBetween_try(SEXP fromSEXP, SEXP toSEXP, SEXP includeFirstSEXP, SEXP includeLastSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::DateVector >::type from(fromSEXP);
    Rcpp::traits::input_parameter< Rcpp::DateVector >::type to(toSEXP);
    Rcpp::traits::input_parameter< bool >::type includeFirst(includeFirstSEXP);
    Rcpp::traits::input_parameter< bool >::type includeLast(includeLastSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(businessDaysBetween(from, to, includeFirst, includeLast, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_businessDaysBetween(SEXP fromSEXP, SEXP toSEXP, SEXP includeFirstSEXP, SEXP includeLastSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_businessDaysBetween_try(fromSEXP, toSEXP, includeFirstSEXP, includeLastSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getHolidays
Rcpp::DateVector getHolidays(Rcpp::Date from, Rcpp::Date to, bool includeWeekends, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_getHolidays_try(SEXP fromSEXP, SEXP toSEXP, SEXP includeWeekendsSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Date >::type from(fromSEXP);
    Rcpp::traits::input_parameter< Rcpp::Date >::type to(toSEXP);
    Rcpp::traits::input_parameter< bool >::type includeWeekends(includeWeekendsSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(getHolidays(from, to, includeWeekends, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getHolidays(SEXP fromSEXP, SEXP toSEXP, SEXP includeWeekendsSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getHolidays_try(fromSEXP, toSEXP, includeWeekendsSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getBusinessDays
Rcpp::DateVector getBusinessDays(Rcpp::Date from, Rcpp::Date to, Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_getBusinessDays_try(SEXP fromSEXP, SEXP toSEXP, SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Date >::type from(fromSEXP);
    Rcpp::traits::input_parameter< Rcpp::Date >::type to(toSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(getBusinessDays(from, to, xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getBusinessDays(SEXP fromSEXP, SEXP toSEXP, SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getBusinessDays_try(fromSEXP, toSEXP, xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getCalendar
Rcpp::XPtr<QlCal::CalendarContainer> getCalendar(std::string calstr);
static SEXP _qlcal_getCalendar_try(SEXP calstrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< std::string >::type calstr(calstrSEXP);
    rcpp_result_gen = Rcpp::wrap(getCalendar(calstr));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getCalendar(SEXP calstrSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getCalendar_try(calstrSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getName
std::string getName(Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_getName_try(SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(getName(xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getName(SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getName_try(xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}
// getId
std::string getId(Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> xp);
static SEXP _qlcal_getId_try(SEXP xpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>> >::type xp(xpSEXP);
    rcpp_result_gen = Rcpp::wrap(getId(xp));
    return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _qlcal_getId(SEXP xpSEXP) {
    SEXP rcpp_result_gen;
    {
        Rcpp::RNGScope rcpp_rngScope_gen;
        rcpp_result_gen = PROTECT(_qlcal_getId_try(xpSEXP));
    }
    Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
    if (rcpp_isInterrupt_gen) {
        UNPROTECT(1);
        Rf_onintr();
    }
    bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
    if (rcpp_isLongjump_gen) {
        Rcpp::internal::resumeJump(rcpp_result_gen);
    }
    Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error");
    if (rcpp_isError_gen) {
        SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen);
        UNPROTECT(1);
        (Rf_error)("%s", CHAR(rcpp_msgSEXP_gen));
    }
    UNPROTECT(1);
    return rcpp_result_gen;
}

// validate (ensure exported C++ functions exist before calling them)
static int _qlcal_RcppExport_validate(const char* sig) { 
    static std::set<std::string> signatures;
    if (signatures.empty()) {
        signatures.insert("void(*setCalendar)(std::string)");
        signatures.insert("Rcpp::Date(*advanceDate)(Rcpp::Date,int,const std::string&,const std::string&,bool,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::LogicalVector(*isBusinessDay)(Rcpp::Nullable<Rcpp::DateVector>,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::LogicalVector(*isHoliday)(Rcpp::Nullable<Rcpp::DateVector>,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::LogicalVector(*isWeekend)(Rcpp::Nullable<Rcpp::DateVector>,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::LogicalVector(*isEndOfMonth)(Rcpp::Nullable<Rcpp::DateVector>,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::DateVector(*getEndOfMonth)(Rcpp::DateVector,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::DateVector(*adjust_cpp)(Rcpp::DateVector,int,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::DateVector(*advanceUnits_cpp)(Rcpp::DateVector,int,int,int,bool,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::NumericVector(*businessDaysBetween)(Rcpp::DateVector,Rcpp::DateVector,bool,bool,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::DateVector(*getHolidays)(Rcpp::Date,Rcpp::Date,bool,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::DateVector(*getBusinessDays)(Rcpp::Date,Rcpp::Date,Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("Rcpp::XPtr<QlCal::CalendarContainer>(*getCalendar)(std::string)");
        signatures.insert("std::string(*getName)(Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
        signatures.insert("std::string(*getId)(Rcpp::Nullable<Rcpp::XPtr<QlCal::CalendarContainer>>)");
    }
    return signatures.find(sig) != signatures.end();
}

// registerCCallable (register entry points for exported C++ functions)
RcppExport SEXP _qlcal_RcppExport_registerCCallable() { 
    R_RegisterCCallable("qlcal", "_qlcal_setCalendar", (DL_FUNC)_qlcal_setCalendar_try);
    R_RegisterCCallable("qlcal", "_qlcal_advanceDate", (DL_FUNC)_qlcal_advanceDate_try);
    R_RegisterCCallable("qlcal", "_qlcal_isBusinessDay", (DL_FUNC)_qlcal_isBusinessDay_try);
    R_RegisterCCallable("qlcal", "_qlcal_isHoliday", (DL_FUNC)_qlcal_isHoliday_try);
    R_RegisterCCallable("qlcal", "_qlcal_isWeekend", (DL_FUNC)_qlcal_isWeekend_try);
    R_RegisterCCallable("qlcal", "_qlcal_isEndOfMonth", (DL_FUNC)_qlcal_isEndOfMonth_try);
    R_RegisterCCallable("qlcal", "_qlcal_getEndOfMonth", (DL_FUNC)_qlcal_getEndOfMonth_try);
    R_RegisterCCallable("qlcal", "_qlcal_adjust_cpp", (DL_FUNC)_qlcal_adjust_cpp_try);
    R_RegisterCCallable("qlcal", "_qlcal_advanceUnits_cpp", (DL_FUNC)_qlcal_advanceUnits_cpp_try);
    R_RegisterCCallable("qlcal", "_qlcal_businessDaysBetween", (DL_FUNC)_qlcal_businessDaysBetween_try);
    R_RegisterCCallable("qlcal", "_qlcal_getHolidays", (DL_FUNC)_qlcal_getHolidays_try);
    R_RegisterCCallable("qlcal", "_qlcal_getBusinessDays", (DL_FUNC)_qlcal_getBusinessDays_try);
    R_RegisterCCallable("qlcal", "_qlcal_getCalendar", (DL_FUNC)_qlcal_getCalendar_try);
    R_RegisterCCallable("qlcal", "_qlcal_getName", (DL_FUNC)_qlcal_getName_try);
    R_RegisterCCallable("qlcal", "_qlcal_getId", (DL_FUNC)_qlcal_getId_try);
    R_RegisterCCallable("qlcal", "_qlcal_RcppExport_validate", (DL_FUNC)_qlcal_RcppExport_validate);
    return R_NilValue;
}

static const R_CallMethodDef CallEntries[] = {
    {"_qlcal_setCalendar", (DL_FUNC) &_qlcal_setCalendar, 1},
    {"_qlcal_advanceDate", (DL_FUNC) &_qlcal_advanceDate, 6},
    {"_qlcal_isBusinessDay", (DL_FUNC) &_qlcal_isBusinessDay, 2},
    {"_qlcal_isHoliday", (DL_FUNC) &_qlcal_isHoliday, 2},
    {"_qlcal_isWeekend", (DL_FUNC) &_qlcal_isWeekend, 2},
    {"_qlcal_isEndOfMonth", (DL_FUNC) &_qlcal_isEndOfMonth, 2},
    {"_qlcal_getEndOfMonth", (DL_FUNC) &_qlcal_getEndOfMonth, 2},
    {"_qlcal_adjust_cpp", (DL_FUNC) &_qlcal_adjust_cpp, 3},
    {"_qlcal_advanceUnits_cpp", (DL_FUNC) &_qlcal_advanceUnits_cpp, 6},
    {"_qlcal_businessDaysBetween", (DL_FUNC) &_qlcal_businessDaysBetween, 5},
    {"_qlcal_getHolidays", (DL_FUNC) &_qlcal_getHolidays, 4},
    {"_qlcal_getBusinessDays", (DL_FUNC) &_qlcal_getBusinessDays, 3},
    {"_qlcal_getCalendar", (DL_FUNC) &_qlcal_getCalendar, 1},
    {"_qlcal_getName", (DL_FUNC) &_qlcal_getName, 1},
    {"_qlcal_getId", (DL_FUNC) &_qlcal_getId, 1},
    {"_qlcal_RcppExport_registerCCallable", (DL_FUNC) &_qlcal_RcppExport_registerCCallable, 0},
    {NULL, NULL, 0}
};

RcppExport void R_init_qlcal(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
