in Education by
I am working on a collection of classes used for video playback and recording. I have one main class which acts like the public interface, with methods like play(), stop(), pause(), record() etc... Then I have workhorse classes which do the video decoding and video encoding. I just learned about the existence of nested classes in C++, and I'm curious to know what programmers think about using them. I am a little wary and not really sure what the benefits/drawbacks are, but they seem (according to the book I'm reading) to be used in cases such as mine. The book suggests that in a scenario like mine, a good solution would be to nest the workhorse classes inside the interface class, so there are no separate files for classes the client is not meant to use, and to avoid any possible naming conflicts? I don't know about these justifications. Nested classes are a new concept to me. Just want to see what programmers think about the issue. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I would be a bit reluctant to use nested classes here. What if you created an abstract base class for a "multimedia driver" to handle the back-end stuff (workhorse), and a separate class for the front-end work? The front-end class could take a pointer/reference to an implemented driver class (for the appropriate media type and situation) and perform the abstract operations on the workhorse structure. My philosophy would be to go ahead and make both structures accessible to the client in a polished way, just under the assumption they would be used in tandem. I would reference something like a QTextDocument in Qt. You provide a direct interface to the bare metal data handling, but pass the authority along to an object like a QTextEdit to do the manipulation.

Related questions

0 votes
    I work on graphics applications and have been using shared & unique pointers essentially because it handles memory ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    I've been reading the legacy code,which invloves in the customized memory pooling system, then I found that ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    Can we create Dynamic Classes in Objective C? If Yes, Explain how to create with a valid use case?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    I had a program working good (without prompting errors) using references, but I decided to use a pointer-to-pointer array ... that it is there because I have put two flags (cout...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    I am currently working on a personal project in C++, and I'm having a lot of fun learning. I just learned some ... MainMenu::~MainMenu(){} void MainMenu::displayMenu() { std::cout...
asked May 3, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    All compilers I could get my hands on agree that this is fine: template auto foo(Check, T...) - ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I am trying to understand the usage of private const in the class. My understanding is that private const is used to make ... (void) { int const MyExample::x = 3; std::cout...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I want to improve the next code, calculating the mean: void calculateMeanStDev8x8Aux(cv::Mat* patch, int sx, int sy, int& ... the next loop with NEON intrinsics: for (int i=0; i...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    If two vectors with different lengths perform some operation, the elements of the shorter vector will be used ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    The line of code in R language should begin with a ________________ (a) Hash symbol (b) Alphabet (c) ... Debugging of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    ________ function can be used to add datasets in R provided with the columns in the datasets should be the same ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Wt is coding classes please help me in this question give a valid answer please I will mark them brainlist and ... give valid answer. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
...