Commit f20c477d authored by Volker Krause's avatar Volker Krause
Browse files

Introduce LocalBusiness between Organization and hotels/restaurants

Needed by PBI. Macro naming is now slightly suboptimal, but that can be
changed separately.
parent 4717eb77
......@@ -112,6 +112,11 @@ KITINERARY_MAKE_CLASS_IMPL(Class) \
Class::Class() : d(*s_ ## Class ## _shared_null()) {} \
Class::Class(Class ## Private *dd) : d(dd) {}
#define KITINERARY_MAKE_INTERMEDIATE_CLASS(Class, Base) \
KITINERARY_MAKE_CLASS_IMPL(Class) \
Class::Class() : Base(s_ ## Class ## _shared_null()->data()) {} \
Class::Class(Class ## Private *dd) : Base(dd) {}
#define KITINERARY_MAKE_SUB_CLASS(Class, Base) \
KITINERARY_MAKE_CLASS_IMPL(Class) \
Class::Class() : Base(s_ ## Class ## _shared_null()->data()) {}
......
......@@ -62,18 +62,25 @@ KITINERARY_MAKE_SUB_CLASS(Airline, Organization)
KITINERARY_MAKE_PROPERTY(Airline, QString, iataCode, setIataCode)
KITINERARY_MAKE_OPERATOR(Airline)
class FoodEstablishmentPrivate: public OrganizationPrivate
class LocalBusinessPrivate : public OrganizationPrivate
{
KITINERARY_PRIVATE_GADGET(LocalBusiness)
};
KITINERARY_MAKE_INTERMEDIATE_CLASS(LocalBusiness, Organization)
KITINERARY_MAKE_OPERATOR(LocalBusiness)
class FoodEstablishmentPrivate: public LocalBusinessPrivate
{
KITINERARY_PRIVATE_GADGET(FoodEstablishment)
};
KITINERARY_MAKE_SUB_CLASS(FoodEstablishment, Organization)
KITINERARY_MAKE_SUB_CLASS(FoodEstablishment, LocalBusiness)
KITINERARY_MAKE_OPERATOR(FoodEstablishment)
class LodgingBusinessPrivate : public OrganizationPrivate
class LodgingBusinessPrivate : public LocalBusinessPrivate
{
KITINERARY_PRIVATE_GADGET(LodgingBusiness)
};
KITINERARY_MAKE_SUB_CLASS(LodgingBusiness, Organization)
KITINERARY_MAKE_SUB_CLASS(LodgingBusiness, LocalBusiness)
KITINERARY_MAKE_OPERATOR(LodgingBusiness)
}
......
......@@ -64,14 +64,24 @@ class AirlinePrivate;
*/
class KITINERARY_EXPORT Airline : public Organization
{
KITINERARY_GADGET(Airline)
KITINERARY_BASE_GADGET(Airline)
KITINERARY_PROPERTY(QString, iataCode, setIataCode)
};
class LocalBusinessPrivate;
/** LocalBusiness.
* @see https://schema.org/LocalBusiness
*/
class KITINERARY_EXPORT LocalBusiness : public Organization
{
KITINERARY_BASE_GADGET(LocalBusiness)
};
/** Hotel.
* @see https://schema.org/LodgingBusiness
*/
class KITINERARY_EXPORT LodgingBusiness: public Organization
class KITINERARY_EXPORT LodgingBusiness: public LocalBusiness
{
KITINERARY_GADGET(LodgingBusiness)
};
......@@ -79,7 +89,7 @@ class KITINERARY_EXPORT LodgingBusiness: public Organization
/** Food-related business (such as a restaurant, or a bakery).
* @see https://schema.org/FoodEstablishment
*/
class KITINERARY_EXPORT FoodEstablishment: public Organization
class KITINERARY_EXPORT FoodEstablishment: public LocalBusiness
{
KITINERARY_GADGET(FoodEstablishment)
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment