Questions tagged [interface-class]

12 questions
2
votes
1 answer

"One or more multiply defined symbols found". Static and friend function

I'm trying to use interface classes and I have the following class structure: IBase.h: #pragma once class IBase { protected: virtual ~IBase() = default; public: virtual void Delete() = 0; IBase& operator=(const IBase&) =…
2
votes
1 answer

Is there any way to make each class that implements interface Ae has a List of one of the concrete classes that implement Ba as property?

I have an interface (Ae) that has a list of objects (List) from another interface (Ba). I have a class that implements interface Ae. I have several classes that implement the Ba interface. Is there any way to make each class that implements…
1
vote
1 answer

Java interface loose coupling advantages in realworld?

Can someone help me out, I read some Java tight and loose coupling article. I had certain doubts in loose coupling watched several YouTube videos and articles, but still couldn't grasp certain points. I will explain what I understood and what…
1
vote
0 answers

How to add an optional model class as viewmodel property in ASP.net MVC

I have an ASP.net MVC project, in which i am binding a viewmodel with multiple classes, some of these classes are mandatory, some of them are optional as they can be used for certain type of view. public class BaseModel { public bool IsCompleted…
1
vote
1 answer

How to access GPIO, I²C, SPI, and PWM on Windows 10 using SetupDiGetClassDevs() function and what is the importance of GUID over here?

How do I access GPIO, I²C, SPI, PWM, etc. in the Windows environment? Currently I have two Intel NUC5i5MYBE motherboards. One board has WindRiver Linux and another one has Windows 10 Enterprise. On Linux, I don't have any trouble while accessing all…
0
votes
0 answers

C# interface class is not visible

I have an issue where the compiler doesn't appear be be seeing the interface class correctly. I have a base class, called Ctrl, and a number of derived classes, Ctrl_BUTTON, Ctrl_CHECKBOX, etc. Some but not all of them need to have a Font property,…
Mark Roworth
  • 409
  • 2
  • 15
0
votes
0 answers

C# How to override the Enabled property of a user control that implements an interface that also has an Enabled property

I have a UserControl that implements an interface class IPropertyListItemType. I would like that the interface class requires it to override the Enabled property of the control. Within my interface class I have: bool Enabled { get; set; } Within my…
Mark Roworth
  • 409
  • 2
  • 15
0
votes
0 answers

friend declaration of interface class in abstract base class

So I was thinking about trying to program the tetris game in c++ with the sfml and I thought about how I could implement the game and realized it could be a could exercice on inheritance. I thought I will have: -an abstract base class that will…
grybouilli
  • 185
  • 2
  • 11
0
votes
1 answer

Inheritance data annotations from abstract class to child class by interface?

this is my parent abstract class : public abstract class PersonViewModel:IPersonViewModel { #region DataValidatorModel [Required(ErrorMessage = "ErrorInsertYourMobileNumber")] [Display(Name = "MobileNumber")] //--RegularExpression…
0
votes
0 answers

try to use interface in codeigniter 3.0 return error Fatal error: Interface 'crudmodelinterface' not found

I want to use an interface inside the Codeigniter framework. I'm using a fresh built Codeigniter 3.0 project, and by following a tutorial I created the following: MY_Loader in application/core
-1
votes
1 answer

What is the seperate implementation interfact class idiom and when do I use it?

I have occasionally come across what I can only describe as the "interface-implementation idiom", where a class is separated into an "interface class" and an "implementation class". What is the philosophy or reasoning behind this? What is an example…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
-5
votes
2 answers

Generate Random Number Method in Interface Class

I have an interface class and in this class I need to create an abstract method that generates a random int. However, when I try to compile I get an error because abstract classes cannot have bodies. How can I create an abstract method that…
Nuki
  • 3
  • 3