Since my last question had too much code in it, I tried to make the simplest example of what I'm trying to do. Take this for example,..
#include <iostream>
using namespace std;
class String
{
    public:
    private:
};
class ClassTwo
{
    public:
        int memberVariable;
    private:
};
class ClassOne
{
    public:
        ClassOne (ClassTwo&, String&);
        ~ClassOne();
    private:
        ClassTwo& classTwoReference;
        String& stringReference;
};
ClassOne::ClassOne (ClassTwo& two, String& string)
    : classTwoReference (two), stringReference (string)
{
    two.memberVariable = 3;
}
ClassOne::~ClassOne()
{
}
int main()
{
    String stringObject;
    ClassTwo classTwoObject;
    ClassOne classOneObject (classTwoObject, stringObject);
}
In JUCE, which is the API I'm using to code a VST Plugin, there is a string class that JUCE names "String". I'm not sure exactly what the constructor does, but you can use something like this to create a String object.
String newString("string");
The ClassTwo in my case, is the AudioProcessor class which has a public member variable that I can access from ClassOne like this.
two.memberVariable = 3;
The ClassOne in my case, is a custom Component(I named it PixelSlider) that I'm using in my GUI. It uses a slider listener to check the status of a slider and modify the member variable in ClassTwo(AudioProcessor). I can do this fine using the method above, but the issue is that I want to create as many ClassOne(PixelSlider) objects as I need. I want to pass them a String object that tells them what member variable of ClassTwo(AudioProcessor) to modify. Logically, this would be done by passing a reference to a String object with the same string value as the name of the ClassTwo member variable. Like this,...
ClassOne::ClassOne (ClassTwo& two, String& string)
        : classTwoReference (two), stringReference (string)
    {
        two.(string) = 3;
    }
This doesn't work in JUCE, but can anybody tell me a way to get this done without having to create a bunch of different classes almost exactly like ClassOne(PixelSlider) that modify different ClassTwo(AudioProcessor) member variables?
 
    