Answer the question
In order to leave comments, you need to log in
C++ interfaces like in java, declaration inside a function how to make it beautiful?
There is a virtual class c++
class IEvent {
public:
virtual void onClick(int index) = 0;
};
struct audioAdapterArtistEvents : AdapterAudio::IEvent {
PlaylistGUIManager &base;
explicit audioAdapterArtistEvents(PlaylistGUIManager &base) : base(base) {};
void onClick(int index) override {
base.mediaServiceBase->getPlaySession()->BasePlayAudio(base.mAudioAdapter.visibleList,index);
}
};
mAudioAdapter.onClickArtist(new audioAdapterArtistEvents(*this));
mAudioAdapter.onClickArtist(new AdapterAudio.IEvent() {
@Override
public void onClick(int index) {
//....
}
});
Answer the question
In order to leave comments, you need to log in
Is it possible somehow in c++ to declare a class inside a function parameter like in java?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question