Esempio n. 1
0
Field Regnal::get_jdn( const Field* fields ) const
{
    FieldVec fs = get_base_fields( fields );
    if( fs.size() == 0 ) {
        return f_invalid;
    }
    return m_eras[fields[0]].base->get_jdn( &fs[0] );
}
Esempio n. 2
0
bool Regnal::set_fields_as_next_last( Field* fields, const Field* mask ) const
{
    Field e = mask[0];
    if( e < 0 || e >= (int) m_eras.size() ) {
        return false;
    }
    if( mask[1] == f_invalid ) {
        return false;
    }
    FieldVec m = get_base_fields( mask );
    FieldVec f = get_base_fields( fields );
    Record rec( m_eras[e].base, &f[0], f.size() );
    if( rec.set_fields_as_next_last( &m[0] ) ) {
        if( rec.get_jdn() > m_eras[e].end ) {
            return false;
        }
        return make_regnal_fields( fields, e, rec );
    }
    return false;
}