Is this Factory pattern or Strategy pattern? c/c++ ,And proposing an alternative solution

The idea is that when we want to create an object of some type, we will only use a robotcreator and enum from the interface. I would like to understand what template design I used because it sometimes looks like a factory and sometimes like a strategy.

Should I use define or not? I will also be happy to receive new ideas to implement.


 class InterfaceRobot     {    public:     InterfaceRobot();     enum RobType { Y=0, C=1, D=2, F=3 };      virtual void open() = 0;     virtual void close() = 0;  };  #endif // INTERFACEROBOT_H 


class RobotCreator :public InterfaceRobot { public:     RobotCreator(InterfaceRobot::RobType _robType);     void open();     void close();     ~RobotCreator();  private:     InterfaceRobot *Robot; /** pointer to InterfaceRobot**/ }; 


RobotCreator::RobotCreator(InterfaceRobot::RobType _robType) {     switch (_robType)     {     case InterfaceRobot::C:         this->Robot = new c();     break;     case InterfaceRobot::Y:         this->Robot = new y();     break;     case InterfaceRobot::D:          this->Robot = new D();     break;     case InterfaceRobot::F:         this->Robot = new F();     break;     } }  void RobotCreator::open() {     this->Robot->open(); }  void RobotCreator::close() {      this->Robot->close(); }  RobotCreator::~RobotCreator() {     cout << " d'tor of RobotCreator" << endl;     if (this->Robot!=NULL)     {         delete[]  this->dlRobot;         this->Robot = NULL;     } } 

use in main:

int main() {   RobotCreator rob(InterfaceRobot::Y);;  rob.close();   RobotCreator rob2(InterfaceRobot::C);;  rob2.close(); } 

Feedback Sought on Java Reflection Factory Example

I set out to create an example or proof of concept of an idea I had and would be interested in receiving constructive feedback on my idea. I needed a Java factory pattern that allowed the end-user of the application to extend it (think add-ons, plug-ins, user contributed content, etc.). So I created a Java factory that uses reflection. While I am doubtful that I am the first to have done this, I have not found [any] examples of it. In my example, I created an abstract class called Vehicle. I then extended Vehicle a number of times (i.e. car, train, boat, airplane, etc.) and placed the subclasses in a separate package. In my example, my factory has a class scanner (does not currently support JAR files) that registers each subclass. Then the factory can be easily called using some class data (i.e. ID, name, whatever) to create a new instance of the subclass. I have included a link to the repo in GitHub (I hope that makes it easier to browse/review). What are your thoughts? Is this practical? Useful? Are there obvious improvements? Easily adapted to support JAR files?

I do want to note that I am aware of Google Guava and the Reflections Library. I wanted to create an example without dependencies on other libraries.

To see the underlying code, please follow link to GitHub repo.


/*   * Create a new instance of the reflection factory by   * passing the package name to the constructor. The class  * scanner will look in this package for classes. All of the  * classes in this package must share the same superclass -  * Vehicle in this case.  */ VehicleFactory vehicleFactory = new VehicleFactory("org.codehamster.vehicles");  /*   * Call the getVehicle() method with the identifier ("name")  * of the class to create a new instance of.  */ Vehicle vehicleOne = vehicleFactory.getVehicle("boat"); Vehicle vehicleTwo = vehicleFactory.getVehicle("train"); Vehicle vehicleThree = vehicleFactory.getVehicle("truck"); Vehicle vehicleFour = vehicleFactory.getVehicle("airplane"); Vehicle vehicleFive = vehicleFactory.getVehicle("car");  /*   * Call each of the new classes with the println() method  * to invoke the toString() method and verify the output  * is correct.  */ System.out.println(vehicleOne); System.out.println(vehicleTwo); System.out.println(vehicleThree); System.out.println(vehicleFour); System.out.println(vehicleFive); 


Vehicle is a boat Vehicle is a train Vehicle is a truck Vehicle is a airplane Vehicle is a car 

Bench Lathes factory

ZHENGZHOU TIMEWAY MACHINE TOOL CO., LTD. is a professional machine tool supplier.
Our factory is the joint-stock enterprise, has more than 60 years of machine tool development and manufacturing history, is the largest machine tool manufacturer in central China, is the “National Torch Plan Key High-tech Enterprise”, “China Industry Leading Enterprise”, “China Machinery Industry 500 “, China’s machine tool industry” well-brand Top Ten Enterprises “.
The factory occupies more than 500 acres, built a foundry, machining, heat treatment, assembly, painting, logistics and other domestic advanced production lines, with vertical machining centers, horizontal machining center, five-sided machining centers, large boring and milling machine, large German rail grinder, Zeiss coordinate measuring instrument, gear detector and laser interferometer and other advanced equipment, instruments and a total of more than 600 sets.
Our product mainly cover conventional lathe, CNC lathe, CNC oil country lathe, vertical lathe, milling machine, CNC machining center, drilling machines, grinding machines, shaping/slotting machines, sawing machines and related accessories & tools, etc.
With many years’ experience in machine production and export, as well as skilled staff members, we believe we can supply more and more quality machines to clients from different countries and regions, and can make more and more friends globally.
Our exclusive mission: Supply clients with quality machines, competitive prices and reliable services!
Our top motto: Satisfy clients, satisfy ourselves!Bench Lathes factory

After Factory Reset, Android Galaxy Camera Touchscreen is unresponsive

I met the weirdest thing I ever have. I have a galaxy camera gc100, It works very well without any problems. Since I decide to lend it to my friend, I did a factory reset. After the factory reset, everything looks fine and the initial setup screen “Select language” appears. BUT, I can not touch anything on the screen. It seems that the touch is simply unresponsive at all until the screen turns off by timeout. And then I tried (1) hard reboot, (2) go to Maintenance boot mode by pressing power and zoom out and did delete cache and factory reset again. (3) flash stock rom. (4) take out of the battery and then holding pressing the power button for more than 1 minute and then insert the battery and boot. (did three times). But none of them works. This is just weird and I can not find anyone on the Internet having the same issue as me. Other people met unresponsive touch screen and then did hard reset to fix the issue. Mine is entirely opposite. I don’t have any problems, but factory/hard reset causing the touch screen is unresponsive at initial setup screen. Do anyone have any clue how I can workaround this issue? Thanks a lot. (Btw the system is still functioning because I can adjust volume and take screenshots by using the physical buttons).

Incorrect hostname in terminal after factory reset

I wiped out Mac and reinstalled (Mojave) (logout from Cloud, Messages, deauthorized iTunes, erase disk, reinstall). Now my terminal is showing a name that I set up through Preferences -> Sharing on previous instance of system (before reinstall).

I checked Preferences -> Sharing computer Name is: Kathy’s MacBook Pro

When I check in bash:

red-panda:~ kathy$   scutil --get ComputerName Kathy’s MacBook Pro red-panda:~ kathy$   scutil --get LocalHostName Kathys-MacBook-Pro red-panda:~ kathy$   scutil --get HostName HostName: not set 

My questions: 1. Why red-panda is still there after reinstallation? Where that information is stored? If I want to sell the Mac, how can I be sure to wipe all out? 2. Can HostName: not set make any troubles?

Wi-fi wont turn on after root. Not even with factory reset!!! please help me

so, my phone went completely bananas today. It was charging and i swear out of the blue a messange showed up saying the sd card memory was being deleted. So in panick i turned it off. The cellphone then turned itself on and showed a message saying android was being deleted, again in panick i took the battery off. When i turned it on, a message with a “dead” android avatar showed on the screen and the boot options screen showed up. I clicked on reeboot and it had been reseted to factory settings. I was so angry and upset because my whole life and work was on my phone. I spent the entire afternoon dedicated into recovering the data. The only software that seems to find my files costed $ 50. i live in a 3rd world country so thats impossible for me to pay. Then looking online i found another one that seem promising but i had to root my phone for it. in the past i used to be really afraid of doing it but as i had an old phone i rooted once for some trivial stuff i decided to do it. Big mistake. After rooting my wi-fi turned off…for good. When i click the wi-fi switch it turns on for a aplit of a second and back off. i CANNOT turn it on. So i decided to hard reset it again, i mean, i had nothing to lose. NOTHING. I STILL CANT TURN IT ON.

i really need this phone for work, and i do not have money to get a new one. im desesperate. really. i reaaly hope someone can help I understand so little about this but im great at following intructions. I will be so thankfull if anyone can help.

its a samsung Galaxy J5, with android 6.0.1

Redmi Note 7 factory reset via PC

So I was just trying to flash Lineage OS on my new redmi noet 7, since MIUI kinda sucks, and it didnt really seem to work. So after a few tries and restarts, my phone started requesting the Password for an Email address I entered into my lock screen when I first got the phone, in case Id ever loose it and someone would find the person could message me. But as it turns out, the m in my email addresses .com is missing and the phone keeps asking for the emails password to start Android instead of the usual PIN code. I figured I should just try wiping it completely, but after a lot of wasted time and energy, I still havent found a method to factory reset it. Please help, I know this is a very specific issue, but maybe there is someone here who could just help me out. Thanks in advance

Download Bee Factory Mod Apk Endless Money

Welcome to the most exciting Bee idle game! Are you ready to manage your own factory and become the richest man alive?

Bee factory apk
bee factory apk mod
bee factory hack apk
mod apk bee factory
Download Bee Factory Mod Apk with Unlimited Money
download bee factory hack

– Unlock +100 super fun bees
– Sell TONS of honey
– Upgrade your bees and your machines

See YouTube video for proving -…

Download Bee Factory Mod Apk Endless Money