Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::vrp::Order Class Reference

Defines an order that will be visited. More...

Inheritance diagram for gem::vrp::Order:
Collaboration diagram for gem::vrp::Order:

Public Member Functions

 Order ()=default
 Default constructor.
 Order (const Customer &customer)
 Constructs a Order object initialized with Customer information.
 Order (const Order &)=default
 Default copy constructor.
 Order (Order &&) noexcept=default
 Default move constructor noexcept is deduced.
Orderoperator= (const Order &)=default
 Default copy assignment operator.
Orderoperator= (Order &&) noexcept=default
 Default move assignment operator.
bool operator== (Order const &order) const
 Compares two Order objects for equality.
bool operator!= (Order const &order) const
 Compares two Order objects for equality.
LargeInteger getId () const noexcept
 Get the id of the order.
const CoordinatesRef getCoordinates () const noexcept
 Retrieves the coordinates of the order.
CoordinatesRef getCoordinates ()
 Provides direct access to modify the coordinates of the order.
OrdersetCoordinates (const Coordinates &coords) noexcept
 Set the coordinates of the order.
const StringRef getAlias () const noexcept
 Retrieves the alias of this order.
OrdersetAlias (const String &alias) noexcept
 Sets the alias for this order.
const StringRef getFirstName () const noexcept
 Retrieves the first name of the owner of the order.
OrdersetFirstName (const String &firstName) noexcept
 Sets the fist name of the owner of the order.
const StringRef getLastName () const noexcept
 Retrieves the last name of the owner of the order.
OrdersetLastName (const String &lastName) noexcept
 Sets the last name of the owner of the order.
const AddressInfoRef getAddress () const noexcept
 Retrieves the address associated with the order.
OrdersetAddress (const AddressInfo &address) noexcept
 Sets the address for the order's location.
const StringRef getPhoneNumber () const noexcept
 Retrieves the phone number of the owner of the order.
OrdersetPhoneNumber (const String &phoneNumber) noexcept
 Sets the phone number of the owner of the order, which the driver will use to contact him.
const CustomDataListRef getCustomData () const noexcept
 Get the custom data of the order.
OrdersetCustomData (const CustomDataList &list) noexcept
 Set the order's custom data.
unsigned int getNumberOfPackages () const noexcept
 Get the number of packages which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetNumberOfPackages (unsigned int numberOfPackages) noexcept
 Set the number of packages which has to be delivered at this order or picked-up from this order depending on the order's type.
float getWeight () const noexcept
 Get the weight which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetWeight (float weightKg) noexcept
 Set the weight which has to be delivered at order or picked-up from the order depending on the order's type.
float getCube () const noexcept
 Get the cube which has to be delivered at order or picked-up from the order depending on the order's type.
OrdersetCube (float cube) noexcept
 Set the cube which has to be delivered at order or picked-up from the order depending on the order's type.
std::pair< int, int > getTimeWindow () const noexcept
 Get the time window within which the order must be visited.
OrdersetTimeWindow (std::pair< int, int > timeWindowInMinutes) noexcept
 Set the time window within which the order must be visited.
unsigned int getServiceTime () const noexcept
 Get the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).
OrdersetServiceTime (unsigned int serviceTimeSeconds) noexcept
 Set the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).
EOrderType getType () const noexcept
 Get the order’s type.
OrdersetType (EOrderType orderType) noexcept
 Set the order’s type.
EOrderStatus getStatus () const noexcept
 Get the order’s status.
EOrderState getState () const noexcept
 Get the order’s state.
EOrderPriority getPriority () const noexcept
 Get the order’s priority.
OrdersetPriority (EOrderPriority orderPriority) noexcept
 Set the order’s priority.
float getRevenue () const noexcept
 Get the revenue which has to be received from the order.
OrdersetRevenue (float revenue) noexcept
 Set the revenue which has to be received from the order.
const TimeRef getCreationTime () const noexcept
 Get the date and time when the order was saved.
const CustomerRef getCustomer () const noexcept
 Get the Customer of the order.
OrdersetCustomer (const Customer &customer) noexcept
 Set the Customer of the order.
LargeInteger getDepotId () const noexcept
 Get the id of the depot(MiscLocation) where to which the order belongs.
OrdersetDepotId (LargeInteger depotId) noexcept
 Set the id of the depot where to which the order belongs.

Detailed Description

Defines an order that will be visited.

Implements share-read / copy-on-write Api object over IOrder.

Constructor & Destructor Documentation

◆ Order()

gem::vrp::Order::Order ( const Customer & customer)
inline

Constructs a Order object initialized with Customer information.

Parameters
customerA Customer object containing the initial values for the order's coordinates, alias, first name, last name, phone number and address.

Member Function Documentation

◆ getAddress()

const AddressInfoRef gem::vrp::Order::getAddress ( ) const
inlinenoexcept

Retrieves the address associated with the order.

This address provides a human-readable location for the order's location, complementing the coordinates.

Returns
A constant reference to the AddressInfo object representing the order address.

◆ getAlias()

const StringRef gem::vrp::Order::getAlias ( ) const
inlinenoexcept

Retrieves the alias of this order.

Returns
The alias as a StringRef.

◆ getCoordinates() [1/2]

CoordinatesRef gem::vrp::Order::getCoordinates ( )
inline

Provides direct access to modify the coordinates of the order.

This allows for setting or updating the geographical location of the order.

Returns
A reference to the Coordinates object for modification.

◆ getCoordinates() [2/2]

const CoordinatesRef gem::vrp::Order::getCoordinates ( ) const
inlinenoexcept

Retrieves the coordinates of the order.

These coordinates represent the geographical location of the order.

Returns
A constant reference to the Coordinates object representing the order's location.

◆ getCreationTime()

const TimeRef gem::vrp::Order::getCreationTime ( ) const
inlinenoexcept

Get the date and time when the order was saved.

Returns
The moment when the order was created, as a TimeRef reference.

◆ getCube()

float gem::vrp::Order::getCube ( ) const
inlinenoexcept

Get the cube which has to be delivered at order or picked-up from the order depending on the order's type.

Returns
The total cubic volume of the packages picked up/delivered from this order.
See also
EOrderType

◆ getCustomData()

const CustomDataListRef gem::vrp::Order::getCustomData ( ) const
inlinenoexcept

Get the custom data of the order.

Returns
a list of CustomData objects.

◆ getCustomer()

const CustomerRef gem::vrp::Order::getCustomer ( ) const
inlinenoexcept

Get the Customer of the order.

Returns
The customer to which this order belongs as a reference to the Customer object.

◆ getDepotId()

LargeInteger gem::vrp::Order::getDepotId ( ) const
inlinenoexcept

Get the id of the depot(MiscLocation) where to which the order belongs.

Returns
The depot id (from MiscLocation) to which this order belongs
See also
MiscLocation

◆ getFirstName()

const StringRef gem::vrp::Order::getFirstName ( ) const
inlinenoexcept

Retrieves the first name of the owner of the order.

Returns
The first name as a StringRef.

◆ getId()

LargeInteger gem::vrp::Order::getId ( ) const
inlinenoexcept

Get the id of the order.

It is a unique identifier of the order and it is used for update or delete.

Returns
The id of the order as LargeInteger

◆ getLastName()

const StringRef gem::vrp::Order::getLastName ( ) const
inlinenoexcept

Retrieves the last name of the owner of the order.

Returns
The last name as a StringRef.

◆ getNumberOfPackages()

unsigned int gem::vrp::Order::getNumberOfPackages ( ) const
inlinenoexcept

Get the number of packages which has to be delivered at order or picked-up from the order depending on the order's type.

The default value is 0.

Returns
The number of packages to be pickup/delivered as unsigned int.
See also
EOrderType.

◆ getPhoneNumber()

const StringRef gem::vrp::Order::getPhoneNumber ( ) const
inlinenoexcept

Retrieves the phone number of the owner of the order.

Returns
The phone number as a StringRef.

◆ getPriority()

EOrderPriority gem::vrp::Order::getPriority ( ) const
inlinenoexcept

Get the order’s priority.

High priority orders will be the first to be visited if it is possible.

Returns
The priotiry of the order as a EOrderPriority value.

◆ getRevenue()

float gem::vrp::Order::getRevenue ( ) const
inlinenoexcept

Get the revenue which has to be received from the order.

Returns
The revenue collected from this order

◆ getServiceTime()

unsigned int gem::vrp::Order::getServiceTime ( ) const
inlinenoexcept

Get the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).

Returns
The amount of time the vehicle spends at this order in seconds.

◆ getState()

EOrderState gem::vrp::Order::getState ( ) const
inlinenoexcept

Get the order’s state.

Returns
The state of the order as a EOrderStatus value.

◆ getStatus()

EOrderStatus gem::vrp::Order::getStatus ( ) const
inlinenoexcept

Get the order’s status.

Returns
If the order is scheduled for a route or not as a EOrderStatus value.

◆ getTimeWindow()

std::pair< int, int > gem::vrp::Order::getTimeWindow ( ) const
inlinenoexcept

Get the time window within which the order must be visited.

The unit is minutes since midnight, for example the pair (480, 660) means that the order can be visited between 7:00 AM and 11:00 AM

In case the time window lasts more than 24 hours, the end time is calculated in minutes from the first day. For example for the time window 6:00 PM - 10:00 AM next day we will set the pair (1080, 2040)

Returns
a pair of two Time objects: the first one is the start of the time window and the second one is the end of the time window

◆ getType()

EOrderType gem::vrp::Order::getType ( ) const
inlinenoexcept

Get the order’s type.

Returns
If the order is pickup or delivery as a EOrderType value.

◆ getWeight()

float gem::vrp::Order::getWeight ( ) const
inlinenoexcept

Get the weight which has to be delivered at order or picked-up from the order depending on the order's type.

Returns
The total weight of the packages picked up/delivered from this order in kg.
See also
EOrderType

◆ operator!=()

bool gem::vrp::Order::operator!= ( Order const & order) const
inline

Compares two Order objects for equality.

Parameters
orderAnother Order object to compare against.
Returns
True if both Order objects represent the same data, false otherwise.

◆ operator=() [1/2]

Order & gem::vrp::Order::operator= ( const Order & )
default

Default copy assignment operator.

Replaces the contents of this object with a copy of another Order object.

Returns
A reference to the current object.

◆ operator=() [2/2]

Order & gem::vrp::Order::operator= ( Order && )
defaultnoexcept

Default move assignment operator.

Moves the contents of another Order object into this one.

Returns
A reference to the current object.

◆ operator==()

bool gem::vrp::Order::operator== ( Order const & order) const
inline

Compares two Order objects for equality.

Parameters
orderAnother Order object to compare against.
Returns
True if both Order objects represent the same data, false otherwise.

◆ setAddress()

Order & gem::vrp::Order::setAddress ( const AddressInfo & address)
inlinenoexcept

Sets the address for the order's location.

Parameters
addressThe new address for the order.
Returns
A reference to this Order object after the modification.

◆ setAlias()

Order & gem::vrp::Order::setAlias ( const String & alias)
inlinenoexcept

Sets the alias for this order.

Parameters
aliasThe new alias as a String.
Returns
A reference to this Order object after modification.

◆ setCoordinates()

Order & gem::vrp::Order::setCoordinates ( const Coordinates & coords)
inlinenoexcept

Set the coordinates of the order.

The coordinates cannot be updated, only set at the creation of the order.

Parameters
coordsThe new geographical coordinates for the order's location.
Returns
A reference to this Order object after the modification.

◆ setCube()

Order & gem::vrp::Order::setCube ( float cube)
inlinenoexcept

Set the cube which has to be delivered at order or picked-up from the order depending on the order's type.

By default it is 0.

Parameters
cubeThe total cubic volume of the packages picked up/delivered from this order
Returns
A reference to this Order object after modification.
See also
EOrderType

◆ setCustomData()

Order & gem::vrp::Order::setCustomData ( const CustomDataList & list)
inlinenoexcept

Set the order's custom data.

Used to set other descriptive data; e.g.: regular customer

Parameters
listThe custom data as CustomDataList
Returns
A reference to this Order object after modification.
See also
CustomDataList

◆ setCustomer()

Order & gem::vrp::Order::setCustomer ( const Customer & customer)
inlinenoexcept

Set the Customer of the order.

Parameters
customerA reference to the Customer object
Returns
A reference to this Order object after modification.

◆ setDepotId()

Order & gem::vrp::Order::setDepotId ( LargeInteger depotId)
inlinenoexcept

Set the id of the depot where to which the order belongs.

Parameters
depotIdThe id of the depot (from MiscLocation)
Returns
A reference to this Order object after modification.
See also
MiscLocation

◆ setFirstName()

Order & gem::vrp::Order::setFirstName ( const String & firstName)
inlinenoexcept

Sets the fist name of the owner of the order.

Parameters
firstNameThe first name as a String.
Returns
A reference to this Order object after modification.

◆ setLastName()

Order & gem::vrp::Order::setLastName ( const String & lastName)
inlinenoexcept

Sets the last name of the owner of the order.

Parameters
lastNameThe last name as a String.
Returns
A reference to this Order object after modification.

◆ setNumberOfPackages()

Order & gem::vrp::Order::setNumberOfPackages ( unsigned int numberOfPackages)
inlinenoexcept

Set the number of packages which has to be delivered at this order or picked-up from this order depending on the order's type.

By default it is 0.

Parameters
numberOfPackagesThe number of packages to be pickup or delivered.
Returns
A reference to this Order object after modification.
See also
EOrderType.

◆ setPhoneNumber()

Order & gem::vrp::Order::setPhoneNumber ( const String & phoneNumber)
inlinenoexcept

Sets the phone number of the owner of the order, which the driver will use to contact him.

Parameters
phoneNumberThe last name as a String.
Returns
A reference to this Order object after modification.

◆ setPriority()

Order & gem::vrp::Order::setPriority ( EOrderPriority orderPriority)
inlinenoexcept

Set the order’s priority.

By default it is EOrderPriority::OP_Low.

Parameters
orderPriorityThe order's priority as a EOrderPriority value
Returns
A reference to this Order object after modification.
See also
EOrderPriority

◆ setRevenue()

Order & gem::vrp::Order::setRevenue ( float revenue)
inlinenoexcept

Set the revenue which has to be received from the order.

By default it is 0.

Parameters
revenueThe revenue collected from this order
Returns
A reference to this Order object after modification.

◆ setServiceTime()

Order & gem::vrp::Order::setServiceTime ( unsigned int serviceTimeSeconds)
inlinenoexcept

Set the amount of time (in seconds) that the vehicle has to stay at the current order (to load/unload the goods).

By default it is 0.

Parameters
serviceTimeSecondsThe amount of time the vehicle spends at this order in seconds
Returns
A reference to this Order object after modification.

◆ setTimeWindow()

Order & gem::vrp::Order::setTimeWindow ( std::pair< int, int > timeWindowInMinutes)
inlinenoexcept

Set the time window within which the order must be visited.

The unit is minutes since midnight, for example the pair (480, 660) means that the order can be visited between 7:00 AM and 11:00 AM

In case the time window lasts more than 24 hours, the end time is calculated in minutes from the first day. For example for the time window 6:00 PM - 10:00 AM next day we will set the pair (1080, 2040)

Parameters
timeWindowInMinutesa pair of two ints: the first one is the start of the time window and the second one is the end of the time window
Returns
A reference to this Order object after modification.

◆ setType()

Order & gem::vrp::Order::setType ( EOrderType orderType)
inlinenoexcept

Set the order’s type.

By default it is EOrderType::OT_PickUp.

Parameters
orderTypeThe type of the order as a EOrderType value.
Returns
A reference to this Order object after modification.
See also
EOrderType

◆ setWeight()

Order & gem::vrp::Order::setWeight ( float weightKg)
inlinenoexcept

Set the weight which has to be delivered at order or picked-up from the order depending on the order's type.

By default it is 0. The unit is kg.

Parameters
weightKgThe total weight of the packages picked up/delivered from this order
Returns
A reference to this Order object after modification.
See also
EOrderType