27 #include <doclone/Operation.h>
28 #include <doclone/observer/AbstractSubject.h>
30 #include <doclone/exception/Exception.h>
241 class Clone :
public AbstractSubject {
246 void create()
throw(Exception);
247 void restore()
throw(Exception);
248 void send()
throw(Exception);
249 void receive()
throw(Exception);
253 bool getEmpty()
const;
255 unsigned int getNodesNumber()
const;
257 const std::string &getDevice()
const;
258 void setDevice(
const std::string &device);
259 const std::string &getImage()
const;
260 void setImage(
const std::string &image);
261 const std::string &getAddress()
const;
263 const std::string &getInterface()
const;
265 bool getForce()
const;
void chainOrigin()
Sends an image or a device to the network in link mode.
Definition: Clone.cc:206
void setNodesNumber(unsigned int nodesNum)
Sets the number of receivers in the network.
Definition: Clone.cc:283
bool _force
Mode force enabled/disabled.
Definition: Clone.h:290
void setEmpty(bool empty)
Sets the no-data mode on/off.
Definition: Clone.cc:268
std::string _device
Device path entered by the user.
Definition: Clone.h:280
Clone()
Private constructor for singleton pattern.
Definition: Clone.cc:42
std::string _interface
Ip address of the interface to be used in the link mode.
Definition: Clone.h:284
void restore()
Restores an image in a device.
Definition: Clone.cc:111
void setForce(bool force)
Sets the force mode on/off.
Definition: Clone.cc:358
std::string _image
Image path entered by the user.
Definition: Clone.h:278
Interface of the library.
Definition: Clone.h:241
static Clone * getInstance()
Returns a pointer to a Doclone::Clone object.
Definition: Clone.cc:59
dcOperationType
C wrapper for Doclone::dcOperationType.
Definition: clone.h:313
void setInterface(const std::string &interface)
Sets the IP address of the network interface to be used in the link mode.
Definition: Clone.cc:343
void send()
Sends an image or a device to the network.
Definition: Clone.cc:145
std::string _address
Ip address entered by the user.
Definition: Clone.h:282
Operation * getOperation(dcOperationType type, const std::string &target)
Gets the operation required using its type and target to identify it.
Definition: Clone.cc:409
unsigned int _nodesNumber
Number of receivers entered by the user.
Definition: Clone.h:286
std::vector< Operation * > _operations
Vector with the state of the execution.
Definition: Clone.h:293
void create()
Creates an image of a device.
Definition: Clone.cc:77
void receive()
Receives an image or a device to the network.
Definition: Clone.cc:176
dcEvent
C wrapper for Doclone::dcEvent.
Definition: clone.h:341
void markCompleted(dcOperationType type, const std::string &target)
Marks one operation as completed.
Definition: Clone.cc:384
void setDevice(const std::string &device)
Sets the device on which work.
Definition: Clone.cc:298
void triggerEvent(dcEvent event, const std::string &target)
Used by the library to trigger a general event.
Definition: Clone.cc:450
bool _empty
Empty mode enabled/disabled.
Definition: Clone.h:288
void setAddress(const std::string &address)
Sets the IP address of the server in unicast/multicast mode.
Definition: Clone.cc:328
void chainLink()
Receives an image or a device to the network in link mode.
Definition: Clone.cc:236
~Clone()
Deletes all the objects in the vector of operations and clears it.
Definition: Clone.cc:435
void addOperation(Operation *op)
Adds a pending operation to the vector.
Definition: Clone.cc:368
void setImage(const std::string &image)
Sets the image on which work.
Definition: Clone.cc:313