Proper PROGMEM Commands For Pointers

Hi I am working on a class that build upon some data that is stored in flash (PROGMEM), so there are two structs in which the data is stored lets name them Storage1 and Storage2, as follows:

struct Storage1
{
    const uint8_t ID;
    const uint8_t Properties;
    const char* Name;
    const uint8_t* NoteTokens;
};
                
struct Storage2
{
    const uint8_t ID;
    const uint8_t Properties;
    const char* Name;
    const uint16_t Mapping;
    const uint8_t* GenericInterval;
};

So this storage structs contain information that is relevant at the time creating the class. For ease of use I declared a third struct containing two pointers, one of the type Storage 1, and one with the type Storage 2.

struct Container
{
    const Storage1* container1;
    const Storage2* container2;
};

The use of this third struct will be at the time of indexing these data structures. For example to creating arrays of pointers to Storage1 or Storage2 structs.

For Example:

const Storage1 Item1 PROGMEM =
{
    // Assume all the declarations are ok
};

const Storage2 Item2 PROGMEM =
{
    // Assume all the declarations are ok
};

const Storage3 Array PROGMEM =
{
    {&Item1,NULL},
    {NULL,&Item2}
};

The main goal with these is giving the user the capability create objects three ways, one with a pointer to a Storage1 struct in flash, the second with a pointer to a Storage2 pointer in flash, and the third with a pointer to a Storage3 pointer in flash.

So this would be an example of the declarations of the class constructors:

class myClass
{
    public:
    
        myClass(const Storage1& source);
        myClass(const Storage2& source);
        myClass(const Storage3& source);
};

At this point I know my declarations are ok, and that I am retrieving the data properly from flash because I can properly create a class with the first two constructors. But on the third constructor everything messes up.

My approach was to make the third constructor to call constructor 1 or 2 depending on what was stored on the Storage3 struct, so this third constructor looks like this:

myClass::myClass(const Storage3& source)
{
    void* pointer;

    pointer  = pgm_read_word(&(source.container1));

    if(pointer != NULL)
    {
        (*this) = myClass(*((Storage1*)pointer)); // This is the point where everything messes up
    }
    else
    {
        pointer  = pgm_read_word(&(source.container2));

        if(pointer != NULL)
        {
            (*this) = myClass(*((Storage2*)pointer));  // This is also the point where everything messes up
        }

        else // If there is no data stored call default constructor
        {
            (*this) = myClass();
        }
    }
}

So how can I properly read the pointer to the Storage1 or Storage2 structs that are referenced on the Storage3 object?

I don't really know how else to approach this.

How can I properly call those constructors with a pointer that is stored in flash?

Thanks!

don't put the pointers in progmem. it complicates it and one pointer is only 2 bytes.
or at least make it work without pointers in progmem and then enhance it to store the pointers too

So there is no way to read pointers to progmem stored in progmem?

cheche_romo:
So there is no way to read pointers to progmem stored in progmem?

yes, you read the pointer with pgm_read
but that pointer points to flash so you should read the data then with next pgm_read