HISE Logo Forum
    • Categories
    • Register
    • Login

    [ThirdPartyNode] How do I get ExternalData update to call a function?

    Scheduled Pinned Locked Moved Unsolved C++ Development
    2 Posts 1 Posters 92 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by

      I have some tables as ExternalData working, but how do I tell the rest of the code the tables have updated?

      This crashes:

      void setExternalData(const ExternalData& ed, int index)
      {
              data = ed;
              TableIndexType idx = index;
              ed.referBlockTo(tableValues[idx], 0);
      
             accountForUpdate(); // crashes here
      }
      

      So is there a specific callback of some sort I should use?

      Can't help pressing F5 in the forum...

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU ustk marked this topic as a question on
      • ustkU
        ustk @ustk
        last edited by ustk

        @Christoph-Hart Alright so making it inline does the job, but then the data somehow refuses to ReadLock. This Mean my update function cannot account for it... What's the wizardry here? The WriteLock is still active? But then what do I do?

        ExternalData data;
        
        void setExternalData(const ExternalData& ed, int index)
        {
                data = ed;
                ed.referBlockTo(tableValues, 0);
        
               accountForUpdate(); // crashes here
        }
        
        
        inline void accountForUpdate()
        {
            DataReadLock rl(data);
            
            if (rl)
            {
                // never goes there form setExternalData,
                // but works from other calling points
            }
        }
        

        Can't help pressing F5 in the forum...

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        27

        Online

        1.7k

        Users

        11.8k

        Topics

        102.8k

        Posts